brutalism design
This commit is contained in:
@@ -26,7 +26,7 @@ interface ClientEvents {
|
||||
|
||||
export class Client extends EventEmitter<ClientEvents> {
|
||||
readonly socketId: string
|
||||
readonly userId: string
|
||||
readonly username: string
|
||||
|
||||
channelId: string = ''
|
||||
#inputMuted = false
|
||||
@@ -38,11 +38,11 @@ export class Client extends EventEmitter<ClientEvents> {
|
||||
readonly #producers = new Map<string, types.Producer>()
|
||||
readonly #consumers = new Map<string, types.Consumer>()
|
||||
|
||||
constructor(socketId: string, userId: string, router: types.Router) {
|
||||
constructor(socketId: string, username: string, router: types.Router) {
|
||||
super()
|
||||
|
||||
this.socketId = socketId
|
||||
this.userId = userId
|
||||
this.username = username
|
||||
this.#router = router
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ export class Client extends EventEmitter<ClientEvents> {
|
||||
serialize(): SerializedClient {
|
||||
return {
|
||||
socketId: this.socketId,
|
||||
userId: this.userId,
|
||||
username: this.username,
|
||||
channelId: this.channelId,
|
||||
inputMuted: this.#inputMuted,
|
||||
outputMuted: this.#outputMuted,
|
||||
|
||||
@@ -23,7 +23,7 @@ export default async function (fastify: FastifyInstance) {
|
||||
io.on('connection', async (socket) => {
|
||||
consola.info('[WebRtc]', 'Client connected', socket.id)
|
||||
|
||||
const client = new Client(socket.id, socket.data.user.id, mediasoupRouter)
|
||||
const client = new Client(socket.id, socket.data.user.username, mediasoupRouter)
|
||||
|
||||
defaultChannel.addClient(client)
|
||||
socket.join(defaultChannel.id)
|
||||
|
||||
Reference in New Issue
Block a user