move most of the logic of IOSocketController into a dedicated class

This commit is contained in:
arp
2020-10-15 17:25:16 +02:00
parent 1abae077a3
commit e6bd655527
7 changed files with 713 additions and 735 deletions
+3 -2
View File
@@ -4,9 +4,10 @@ import {stringify} from "circular-json";
import {HttpRequest, HttpResponse} from "uWebSockets.js";
import { parse } from 'query-string';
import {App} from "../Server/sifrr.server";
import {socketManager} from "../Services/SocketManager";
export class DebugController {
constructor(private App : App, private ioSocketController: IoSocketController) {
constructor(private App : App) {
this.getDump();
}
@@ -20,7 +21,7 @@ export class DebugController {
}
return res.writeStatus('200 OK').writeHeader('Content-Type', 'application/json').end(stringify(
this.ioSocketController.getWorlds(),
socketManager.getWorlds(),
(key: unknown, value: unknown) => {
if(value instanceof Map) {
const obj: any = {}; // eslint-disable-line @typescript-eslint/no-explicit-any