private void Forward(Message message) { var connectionsComponent = Owner.Find<ConnectionsComponent>(); if (message.To.HasValue && connectionsComponent.HasConnection(message.To.Value)) { connectionsComponent.GetConnection(message.To.Value) .MessageChannel.Send(message); } else { connectionsComponent.Connections .Where(c => !message.Path.Contains(c.Id)) .ToList() .ForEach(c => c.MessageChannel.Send(message)); } }
private void Handle(Message message) { Owner.Find<ClientInterface>().OnMessageReceived(message); }