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

@ -1,6 +1,7 @@
import { Server } from 'socket.io'
import { TSocket } from '../../../../utilities/types'
import prisma from '../../../../utilities/prisma'
import CharacterManager from '../../../../managers/characterManager'
type Payload = {
id: string
@ -21,7 +22,8 @@ type Payload = {
*/
export default function (socket: TSocket, io: Server) {
socket.on('gm:object:update', async (data: Payload, callback: (success: boolean) => void) => {
if (socket.character?.role !== 'gm') {
const character = CharacterManager.getCharacterFromSocket(socket);
if (character?.role !== 'gm') {
return
}