WIP: ECS / Network System #1

Draft
simponic wants to merge 13 commits from websockets into main
3 changed files with 3 additions and 4 deletions
Showing only changes of commit e4e31978ba - Show all commits

View File

@ -1,7 +1,7 @@
import asyncio import asyncio
from abc import abstractmethod from abc import abstractmethod
from enum import Enum from enum import Enum
from typing import List, Optional, Dict from typing import Dict, List, Optional
from kennel.app import logger from kennel.app import logger
from kennel.engine.entities.entity import Entity, EntityManager from kennel.engine.entities.entity import Entity, EntityManager

View File

@ -9,9 +9,9 @@ from kennel.engine.game import Game
from kennel.engine.systems.network import ( from kennel.engine.systems.network import (
EntityPositionUpdateEvent, EntityPositionUpdateEvent,
Event, Event,
UpstreamEventProcessor,
EventType, EventType,
NetworkSystem, NetworkSystem,
UpstreamEventProcessor,
) )
from kennel.engine.systems.system import SystemManager from kennel.engine.systems.system import SystemManager
from kennel.engine.systems.world import WorldSystem from kennel.engine.systems.world import WorldSystem

View File

@ -1,6 +1,6 @@
import asyncio import asyncio
import uuid import uuid
from typing import Annotated, Optional, List from typing import Annotated, List, Optional
from fastapi import ( from fastapi import (
Cookie, Cookie,
@ -92,7 +92,6 @@ async def websocket_endpoint(
session: Annotated[str, Depends(get_cookie_or_token)], session: Annotated[str, Depends(get_cookie_or_token)],
): ):
await websocket.accept() await websocket.accept()
client = WebSocketClient(websocket)
logger.info(f"Websocket connection established for session {session}") logger.info(f"Websocket connection established for session {session}")
session_entities = create_session_controllable_entities(session) session_entities = create_session_controllable_entities(session)