fix: server start ans socket connection
This commit is contained in:
parent
808904dfd6
commit
3c209d84f2
@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import IEventManager from './Interfaces/IEventManager'
|
||||
import IEventManager from '../Interfaces/IEventManager'
|
||||
|
||||
let instance: EventManager | null = null
|
||||
|
@ -3,8 +3,8 @@ import path from 'path'
|
||||
import bodyParser from 'body-parser'
|
||||
import http from 'http'
|
||||
import { Socket } from 'socket.io'
|
||||
import IEventManager from './Interfaces/IEventManager'
|
||||
import EventManager from './EventManager'
|
||||
import IEventManager from '../Interfaces/IEventManager'
|
||||
import EventManager from '../Entities/EventManager'
|
||||
|
||||
class Server {
|
||||
public app = express()
|
||||
@ -50,12 +50,12 @@ class Server {
|
||||
}
|
||||
|
||||
openSockets = (socketService: any) => {
|
||||
socketService.on('connection', () => {
|
||||
socketService.on('connection', (socket: Socket) => {
|
||||
console.log('client connected')
|
||||
})
|
||||
|
||||
socketService.on('message', (message: any) => {
|
||||
console.log(message)
|
||||
|
||||
socket.on('offsets', (offsets: any[]) => {
|
||||
this.onReceiveOffsets(offsets)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import EventManager from "../../EventManager"
|
||||
import EventManager from "../../Entities/EventManager"
|
||||
|
||||
function makeEventManager () {
|
||||
return new EventManager()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Server } from "socket.io";
|
||||
import Server from "../../Entities/Server"
|
||||
|
||||
function makeServer (port: number) {
|
||||
const defaultPort = 5005
|
||||
|
Loading…
x
Reference in New Issue
Block a user