1
0
forked from noxious/server

Mass replace parameter order (socket,io)>(io,socket), worked on queueing system

This commit is contained in:
2024-09-21 23:54:52 +02:00
parent 10dc9df8a9
commit 9d6de8a1a9
36 changed files with 206 additions and 121 deletions

View File

@ -58,14 +58,15 @@ export class Server {
appLogger.error(`Socket.IO failed to start: ${error.message}`)
}
// Load queue manager
await QueueManager.boot(this.io)
// Add http API routes
await addHttpRoutes(this.app)
// Load user manager
await UserManager.boot()
await QueueManager.boot();
// Load zoneEditor manager
await ZoneManager.boot()
@ -85,7 +86,7 @@ export class Server {
* @private
*/
private async handleConnection(socket: TSocket) {
const eventsPath = path.join(__dirname, 'events')
const eventsPath = path.join(__dirname, 'socketEvents')
try {
await this.loadEventHandlers(eventsPath, socket)
} catch (error: any) {
@ -112,7 +113,7 @@ export class Server {
eventInstance.listen()
} else {
// This is a function-based event
module.default(socket, this.io)
module.default(this.io, socket)
}
} else {
appLogger.warn(`Unrecognized export in ${file.name}`)