Attempt to fix performance :(((
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
import { Server } from 'socket.io'
|
||||
|
||||
import { BaseService } from '#application/base/baseService'
|
||||
import { TSocket, UUID } from '#application/types'
|
||||
import { UUID } from '#application/types'
|
||||
import { Chat } from '#entities/chat'
|
||||
import SocketManager from '#managers/socketManager'
|
||||
import CharacterRepository from '#repositories/characterRepository'
|
||||
import ChatRepository from '#repositories/chatRepository'
|
||||
import MapRepository from '#repositories/mapRepository'
|
||||
|
||||
class ChatService extends BaseService {
|
||||
async sendMapMessage(characterId: UUID, mapId: UUID, message: string): Promise<boolean> {
|
||||
try {
|
||||
const character = await CharacterRepository.getById(characterId)
|
||||
const characterRepository = new CharacterRepository()
|
||||
const mapRepository = new MapRepository()
|
||||
|
||||
const character = await characterRepository.getById(characterId)
|
||||
if (!character) return false
|
||||
|
||||
const map = await MapRepository.getById(mapId)
|
||||
const map = await mapRepository.getById(mapId)
|
||||
if (!map) return false
|
||||
|
||||
const chat = new Chat()
|
||||
|
Reference in New Issue
Block a user