forked from noxious/server
#160 : Fix for being unable to chat after teleporting into another zone
This commit is contained in:
parent
dec6b36699
commit
46fdb3edb6
@ -1,9 +1,9 @@
|
||||
import { Server } from 'socket.io'
|
||||
import { TSocket } from '../../utilities/types'
|
||||
import CharacterRepository from '../../repositories/characterRepository'
|
||||
import ZoneRepository from '../../repositories/zoneRepository'
|
||||
import { isCommand } from '../../utilities/chat'
|
||||
import { gameLogger } from '../../utilities/logger'
|
||||
import CharacterManager from '../../managers/characterManager'
|
||||
|
||||
type TypePayload = {
|
||||
message: string
|
||||
@ -26,7 +26,7 @@ export default class ChatMessageEvent {
|
||||
return
|
||||
}
|
||||
|
||||
const character = await CharacterRepository.getByUserAndId(this.socket.user?.id as number, this.socket.characterId as number)
|
||||
const character = CharacterManager.getCharacterFromSocket(this.socket)
|
||||
if (!character) {
|
||||
gameLogger.error('chat:send_message error', 'Character not found')
|
||||
callback(false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user