fuk it
This commit is contained in:
@ -2,6 +2,7 @@ import { Server } from 'socket.io'
|
||||
import { TSocket } from '../../../utilities/types'
|
||||
import { Zone } from '@prisma/client'
|
||||
import ZoneRepository from '../../../repositories/zoneRepository'
|
||||
import CharacterManager from '../../../managers/characterManager'
|
||||
|
||||
interface IPayload {}
|
||||
|
||||
@ -12,12 +13,13 @@ interface IPayload {}
|
||||
*/
|
||||
export default function (socket: TSocket, io: Server) {
|
||||
socket.on('gm:zone_editor:zone:list', async (data: IPayload, callback: (response: Zone[]) => void) => {
|
||||
if (socket.character?.role !== 'gm') {
|
||||
console.log(`---Character #${socket.character?.id} is not a game master.`)
|
||||
const character = CharacterManager.getCharacterFromSocket(socket);
|
||||
if (character?.role !== 'gm') {
|
||||
console.log(`---Character #${character?.id} is not a game master.`)
|
||||
return
|
||||
}
|
||||
|
||||
console.log(`---GM ${socket.character?.id} has requested zone list via zone editor.`)
|
||||
console.log(`---GM ${character?.id} has requested zone list via zone editor.`)
|
||||
|
||||
try {
|
||||
const zones = await ZoneRepository.getAll()
|
||||
|
Reference in New Issue
Block a user