func (p *Peer) Broadcast(msg *proto.FromClientBroadcastMsg) error {
	log.Infof("peer broadcast: uid=%s, msg=%v", p.uid, msg)

	// validate
	if msg.SID == "" {
		return errors.New("room not found")
	}

	// TODO: nrpc.Publish(roomID, ...
	err := p.s.nrpc.Publish(p.s.islb, proto.IslbBroadcastMsg{
		RoomInfo: proto.RoomInfo{UID: p.uid, SID: msg.SID},
		Info:     msg.Info,
	})
	if err != nil {
		log.Errorf("broadcast error: %s", err.Error())
		return err
	}

	return nil
}
// Broadcast peer send message to peers of room
Broadcast peer send message to peers of room
// Broadcast peer send message to peers of room
func (p *Peer) Broadcast(msg *proto.FromClientBroadcastMsg) error {
	log.Infof("peer broadcast: uid=%s, msg=%v", p.uid, msg)
	if msg.SID == "" {
		return errors.New("room not found")
	}
	err := p.s.nrpc.Publish(p.s.islb, proto.IslbBroadcastMsg{
		RoomInfo: proto.RoomInfo{UID: p.uid, SID: msg.SID},
		Info:     msg.Info,
	})
	if err != nil {
		log.Errorf("broadcast error: %s", err.Error())
		return err
	}
	return nil
}
func ( p * Peer ) Broadcast ( msg * proto . FromClientBroadcastMsg ) error { log . Infof ( " " , p . uid , msg ) if msg . SID == " " { return errors . New ( " " ) } err := p . s . nrpc . Publish ( p . s . islb , proto . IslbBroadcastMsg { RoomInfo : proto . RoomInfo { UID : p . uid , SID : msg . SID } , Info : msg . Info , } ) if err != nil { log . Errorf ( " " , err . Error ( ) ) return err } return nil }
Broadcast peer send message to peers of room
Broadcast peer send message to peers of room
// validate // TODO: nrpc.Publish(roomID, ...