refactor: structure

This commit is contained in:
cha0s 2024-06-23 07:00:10 -05:00
parent 92b167237d
commit 8eec34fd47
4 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import {get, set} from 'idb-keyval';
import {encode} from '@/packets/index.js'; import {encode} from '@/packets/index.js';
import Engine from '../../engine/engine.js'; import Engine from '../../engine.js';
import Server from './server.js'; import Server from './server.js';
class WorkerServer extends Server { class WorkerServer extends Server {
@ -52,7 +52,7 @@ onmessage = async (event) => {
})(); })();
if (import.meta.hot) { if (import.meta.hot) {
import.meta.hot.accept('../../engine/engine.js', async () => { import.meta.hot.accept('../engine/engine.js', async () => {
await engine.disconnectPlayer(0, 0); await engine.disconnectPlayer(0, 0);
postMessage(encode({type: 'ConnectionStatus', payload: 'aborted'})); postMessage(encode({type: 'ConnectionStatus', payload: 'aborted'}));
close(); close();

View File

@ -6,7 +6,7 @@ import {WebSocketServer} from 'ws';
import Server from '@/net/server/server.js'; import Server from '@/net/server/server.js';
import {getSession} from '@/session.server.js'; import {getSession} from '@/session.server.js';
import Engine from './engine/engine.js'; import Engine from './engine.js';
const wss = new WebSocketServer({ const wss = new WebSocketServer({
noServer: true, noServer: true,
@ -85,7 +85,7 @@ async function remakeServer(Engine) {
})(); })();
if (import.meta.hot) { if (import.meta.hot) {
import.meta.hot.accept('./engine/engine.js', async ({default: Engine}) => { import.meta.hot.accept('./engine.js', async ({default: Engine}) => {
await remakeServer(Engine); await remakeServer(Engine);
}); });
} }