forked from noxious/server
#245 : Enhanced asset CRUD logic
This commit is contained in:
@ -22,14 +22,14 @@ export default class CharacterConnectEvent extends BaseEvent {
|
||||
private async handleEvent(data: CharacterConnectPayload, callback: (response: any) => void): Promise<void> {
|
||||
try {
|
||||
if (await this.checkForActiveCharacters()) {
|
||||
this.emitError('You are already connected to another character')
|
||||
this.sendNotificationAndLog('You are already connected to another character')
|
||||
return
|
||||
}
|
||||
|
||||
const character = await this.characterRepository.getByUserAndId(this.socket.userId, data.characterId)
|
||||
|
||||
if (!character) {
|
||||
this.emitError('Character not found or does not belong to this user')
|
||||
this.sendNotificationAndLog('Character not found or does not belong to this user')
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user