forked from noxious/client
TP client fixes
This commit is contained in:
parent
9c309630ae
commit
c7d2937523
@ -23,7 +23,7 @@ type zoneLoadData = {
|
|||||||
characters: CharacterT[]
|
characters: CharacterT[]
|
||||||
}
|
}
|
||||||
|
|
||||||
gameStore.connection?.emit('zone:characterJoin', { zoneId: gameStore.character?.zoneId }, (response: zoneLoadData) => {
|
gameStore.connection?.emit('zone:character:join', { zoneId: gameStore.character?.zoneId }, (response: zoneLoadData) => {
|
||||||
zoneStore.setZone(response.zone)
|
zoneStore.setZone(response.zone)
|
||||||
zoneStore.setCharacters(response.characters)
|
zoneStore.setCharacters(response.characters)
|
||||||
})
|
})
|
||||||
@ -40,6 +40,7 @@ gameStore.connection?.on('zone:character:join', (data: ExtendedCharacterT) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
gameStore.connection?.on('zone:character:leave', (character_id: number) => {
|
gameStore.connection?.on('zone:character:leave', (character_id: number) => {
|
||||||
|
console.log('character left', character_id)
|
||||||
zoneStore.removeCharacter(character_id)
|
zoneStore.removeCharacter(character_id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ export const useZoneStore = defineStore('zone', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeCharacter(character_id: number) {
|
removeCharacter(character_id: number) {
|
||||||
|
console.log('removing character', character_id)
|
||||||
this.characters = this.characters.filter((char) => char.id !== character_id)
|
this.characters = this.characters.filter((char) => char.id !== character_id)
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user