1
0
forked from noxious/server

small clean

This commit is contained in:
2024-05-18 17:30:59 +02:00
parent 14b6443cef
commit 552d9bb4db
4 changed files with 31 additions and 14 deletions

View File

@ -27,16 +27,15 @@ export default function characterZoneLoad(socket: Socket, io: Server) {
socket.join(zone.name);
const characters = await io.in(zone.name).fetchSockets();
const socketConnectionsInRoom = await io.in(zone.name).fetchSockets();
const characters = socketConnectionsInRoom.filter(socket => socket.id !== socket.id);
// update to match with model Character
// send over zone and characters
io.in(zone.name).to(socket.id).emit('character:zone:load', {
zone: zone,
characters: characters.map(socket => ({
id: socket.id
})),
characters: characters,
});
});
}

View File

@ -0,0 +1,8 @@
import { Socket } from 'socket.io';
import {Character, User} from "@prisma/client";
interface NQSocket extends Socket
{
user?: User,
character?: Character
}

View File

@ -0,0 +1,6 @@
import {Character} from "@prisma/client";
interface zoneCharacters extends Character
{
}