private void OnPCPBcst(Atom atom)
{
var channel_id = atom.Children.GetBcstChannelID();
if (channel_id!=null) {
Channel channel;
lock (announcingChannels) {
channel = announcingChannels.Find(c => c.Channel.ChannelID==channel_id).Channel;
}
var group = atom.Children.GetBcstGroup();
var from = atom.Children.GetBcstFrom();
var ttl = atom.Children.GetBcstTTL();
var hops = atom.Children.GetBcstHops();
if (channel!=null && group!=null && from!=null && ttl!=null && ttl.Value>0) {
var bcst = new AtomCollection(atom.Children);
bcst.SetBcstTTL((byte)(ttl.Value-1));
bcst.SetBcstHops((byte)((hops ?? 0)+1));
channel.Broadcast(null, new Atom(Atom.PCP_BCST, bcst), group.Value);
}
}
}