package org.bigbluebutton.core.apps.threedimension
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.ThreeDimension
import org.bigbluebutton.common2.domain.SceneVO
import org.bigbluebutton.core.bus.MessageBus
import org.bigbluebutton.core.running.{ LiveMeeting }
trait AddScenePubMsgHdlr {
this: ThreeDimensionApp2x =>
def handle(msg: AddScenePubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = {
val scens = new collection.mutable.HashMap[String, ThreeDimension]
def broadcastEvent(msg: AddScenePubMsg, userId: String, scene: SceneVO, liveMeeting: LiveMeeting, bus: MessageBus): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, userId)
val envelope = BbbCoreEnvelope(AddScenePubMsg.NAME, routing)
val header = BbbClientMsgHeader(AddScenePubMsg.NAME, liveMeeting.props.meetingProp.intId, userId)
val body = AddScenePubMsgBody(scene)
val event = AddScenePubMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
bus.outGW.send(msgEvent)
}
processPreuploadedScenes(liveMeeting, scens.values.toVector)
broadcastEvent(msg, msg.header.userId, msg.body.scenes, liveMeeting, bus)
}
}