2020-04-06 22:47:58 +00:00
|
|
|
import { register } from './io/helper.mjs'
|
|
|
|
import { contentConnection } from './content/connection.mjs'
|
2020-12-08 11:09:46 +00:00
|
|
|
import { casparStatus } from './casparcg/status.mjs'
|
2020-04-06 22:47:58 +00:00
|
|
|
|
|
|
|
import * as content from './content/routes.mjs'
|
|
|
|
import * as engine from './engine/routes.mjs'
|
|
|
|
import * as graphic from './graphic/routes.mjs'
|
|
|
|
import * as preset from './preset/routes.mjs'
|
|
|
|
import * as settings from './settings/routes.mjs'
|
|
|
|
import * as schedule from './schedule/routes.mjs'
|
|
|
|
|
2020-12-08 11:09:46 +00:00
|
|
|
function onConnection(server, db, logger, data) {
|
2020-04-07 10:57:43 +00:00
|
|
|
const io = server
|
|
|
|
const socket = data
|
2020-04-06 22:47:58 +00:00
|
|
|
const log = logger.child({
|
|
|
|
id: socket.id,
|
|
|
|
})
|
|
|
|
|
|
|
|
let ctx = { io, socket, log, db }
|
|
|
|
|
|
|
|
contentConnection(ctx)
|
2020-12-08 11:09:46 +00:00
|
|
|
casparStatus(ctx)
|
2020-04-06 22:47:58 +00:00
|
|
|
|
|
|
|
register(ctx, 'content', content)
|
|
|
|
register(ctx, 'engine', engine)
|
|
|
|
register(ctx, 'graphic', graphic)
|
|
|
|
register(ctx, 'preset', preset)
|
|
|
|
register(ctx, 'settings', settings)
|
|
|
|
register(ctx, 'schedule', schedule)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default onConnection
|