1
0
forked from noxious/server

made typescript my bitch

This commit is contained in:
2024-05-24 19:37:15 +02:00
parent 552d9bb4db
commit cfc0f03932
9 changed files with 79 additions and 26 deletions

View File

@ -1,7 +1,9 @@
import { Socket, Server } from "socket.io";
import {ISocket} from "../interfaces/socket";
export default function characterConnect(socket: Socket, io: Server) {
export default function characterConnect(socket: ISocket, io: Server) {
socket.on('character:connect', (data) => {
socket.user.username = 'hello'
console.log(`---User ${socket.id} has joined.`);
});
}

View File

@ -0,0 +1,9 @@
import { Socket, Server } from "socket.io";
import {ISocket} from "../interfaces/socket";
export default function characterConnect(socket: ISocket, io: Server) {
socket.on('characters:get', async (data) => {
console.log(socket.user.username)
console.log(`---characters requested.`);
});
}