Replaced all event names with numbers for less bandwidth usage
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { SocketEvent } from '#application/enums';
|
||||
import type { UUID } from '#application/types'
|
||||
|
||||
import { BaseService } from '#application/base/baseService'
|
||||
@ -22,7 +23,7 @@ class ChatService extends BaseService {
|
||||
await chat.setCharacter(character).setMap(map).setMessage(message).save()
|
||||
|
||||
const io = SocketManager.getIO()
|
||||
io.to(mapId).emit('chat:message', chat)
|
||||
io.to(mapId).emit(SocketEvent.CHAT_MESSAGE, chat)
|
||||
return true
|
||||
} catch (error: any) {
|
||||
this.logger.error(`Failed to save chat message: ${error instanceof Error ? error.message : String(error)}`)
|
||||
|
Reference in New Issue
Block a user