This commit is contained in:
Zaxiure
2024-09-20 21:58:38 +02:00
parent b772ade582
commit ed92663313
27 changed files with 117 additions and 68 deletions

View File

@ -3,6 +3,7 @@ import { TSocket } from '../../../../utilities/types'
import path from 'path'
import fs from 'fs'
import prisma from '../../../../utilities/prisma'
import CharacterManager from '../../../../managers/characterManager'
interface IPayload {
object: string
@ -15,7 +16,8 @@ interface IPayload {
*/
export default function (socket: TSocket, io: Server) {
socket.on('gm:object:remove', async (data: IPayload, callback: (response: boolean) => void) => {
if (socket.character?.role !== 'gm') {
const character = CharacterManager.getCharacterFromSocket(socket);
if (character?.role !== 'gm') {
return
}