Example #1
0
        private async Task OnDispatch(DispatchContract contract)
        {
            var targets = GetUsers();
            var packet  = new UnstructuredOutgoingPacket();

            packet.WriteBytes(contract.Data.ToArray());

            if (contract.TargetCharacters.Count > 0)
            {
                targets = targets
                          .Where(u => contract.TargetCharacters.Contains(u.ID))
                          .ToList();
            }

            await Task.WhenAll(targets.Select(t => t.Dispatch(packet)));
        }