bta-proxy/bta_proxy/dpi.py

31 lines
916 B
Python

from asyncio.queues import Queue
from bta_proxy.datainputstream import AsyncDataInputStream
from bta_proxy.packets import *
async def inspect_client(queue: Queue, addr: tuple[str, int]):
dis = AsyncDataInputStream(queue)
while True:
pkt = await Packet.read_packet(dis)
match pkt.packet_id:
case Packet10Flying.packet_id:
continue
case Packet11PlayerPosition.packet_id:
continue
case Packet12PlayerLook.packet_id:
continue
case Packet13LookMove.packet_id:
continue
case Packet255KickDisconnect.packet_id:
break
case _:
print("C", pkt)
async def inspect_server(queue: Queue, addr: tuple[str, int]):
dis = AsyncDataInputStream(queue)
while True:
pkt = await Packet.read_packet(dis)
print("S", pkt)