This commit is contained in:
parent
189404e22c
commit
c370a455bd
@ -126,8 +126,10 @@ export default function (io: SocketServer, router: types.Router) {
|
|||||||
socket.data.consumers = new Map()
|
socket.data.consumers = new Map()
|
||||||
|
|
||||||
socket.on('join', async ({ username, rtpCapabilities }, cb) => {
|
socket.on('join', async ({ username, rtpCapabilities }, cb) => {
|
||||||
if (socket.data.joined)
|
if (socket.data.joined) {
|
||||||
throw new Error('Already joined')
|
consola.error('[WebRtc]', 'Already joined')
|
||||||
|
cb({ error: 'Already joined' })
|
||||||
|
}
|
||||||
|
|
||||||
socket.data.joined = true
|
socket.data.joined = true
|
||||||
socket.data.username = username
|
socket.data.username = username
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user