From 1d35b9b6d54fc7ccce0e58f4fee8522136e01884 Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 20 Jul 2024 21:26:00 -0500 Subject: [PATCH] refactor: packets --- app/engine.js | 2 +- app/net/client/prediction.js | 2 +- app/net/client/remote.js | 2 +- app/{ => net}/packets/action.js | 0 app/{ => net}/packets/admin-action.js | 0 app/{ => net}/packets/connection-status.js | 0 app/{ => net}/packets/ecs-change.js | 0 app/{ => net}/packets/index.js | 0 app/{ => net}/packets/tick.js | 0 app/net/server/worker.js | 2 +- app/routes/_main-menu.play.$/route.jsx | 2 +- 11 files changed, 5 insertions(+), 5 deletions(-) rename app/{ => net}/packets/action.js (100%) rename app/{ => net}/packets/admin-action.js (100%) rename app/{ => net}/packets/connection-status.js (100%) rename app/{ => net}/packets/ecs-change.js (100%) rename app/{ => net}/packets/index.js (100%) rename app/{ => net}/packets/tick.js (100%) diff --git a/app/engine.js b/app/engine.js index 3a30748..fbc5804 100644 --- a/app/engine.js +++ b/app/engine.js @@ -1,5 +1,5 @@ import Ecs from '@/ecs/ecs.js'; -import {decode, encode} from '@/packets/index.js'; +import {decode, encode} from '@/net/packets/index.js'; import { CHUNK_SIZE, RESOLUTION, diff --git a/app/net/client/prediction.js b/app/net/client/prediction.js index d4d8ebb..af47878 100644 --- a/app/net/client/prediction.js +++ b/app/net/client/prediction.js @@ -1,4 +1,4 @@ -import {encode} from '@/packets/index.js'; +import {encode} from '@/net/packets/index.js'; let connected = false; let socket; diff --git a/app/net/client/remote.js b/app/net/client/remote.js index 759ad52..a678307 100644 --- a/app/net/client/remote.js +++ b/app/net/client/remote.js @@ -1,4 +1,4 @@ -import {encode} from '@/packets/index.js'; +import {encode} from '@/net/packets/index.js'; import {CLIENT_PREDICTION} from '@/util/constants.js'; import Client from './client.js'; diff --git a/app/packets/action.js b/app/net/packets/action.js similarity index 100% rename from app/packets/action.js rename to app/net/packets/action.js diff --git a/app/packets/admin-action.js b/app/net/packets/admin-action.js similarity index 100% rename from app/packets/admin-action.js rename to app/net/packets/admin-action.js diff --git a/app/packets/connection-status.js b/app/net/packets/connection-status.js similarity index 100% rename from app/packets/connection-status.js rename to app/net/packets/connection-status.js diff --git a/app/packets/ecs-change.js b/app/net/packets/ecs-change.js similarity index 100% rename from app/packets/ecs-change.js rename to app/net/packets/ecs-change.js diff --git a/app/packets/index.js b/app/net/packets/index.js similarity index 100% rename from app/packets/index.js rename to app/net/packets/index.js diff --git a/app/packets/tick.js b/app/net/packets/tick.js similarity index 100% rename from app/packets/tick.js rename to app/net/packets/tick.js diff --git a/app/net/server/worker.js b/app/net/server/worker.js index 607af4d..887c223 100644 --- a/app/net/server/worker.js +++ b/app/net/server/worker.js @@ -1,6 +1,6 @@ import {del, get, set} from 'idb-keyval'; -import {encode} from '@/packets/index.js'; +import {encode} from '@/net/packets/index.js'; import createEcs from '../../create/ecs.js'; import '../../create/forest.js'; diff --git a/app/routes/_main-menu.play.$/route.jsx b/app/routes/_main-menu.play.$/route.jsx index ababfb8..840b5e6 100644 --- a/app/routes/_main-menu.play.$/route.jsx +++ b/app/routes/_main-menu.play.$/route.jsx @@ -1,7 +1,7 @@ import {useEffect, useState} from 'react'; import {Outlet, useParams} from 'react-router-dom'; -import {decode, encode} from '@/packets/index.js'; +import {decode, encode} from '@/net/packets/index.js'; import styles from './play.module.css';