mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
Decompress data
This commit is contained in:
parent
f7defaed0c
commit
a057004cd2
@ -15,10 +15,13 @@ BeamingDrive Multiplayer (BeamMP) server compatible with BeamMP clients.
|
||||
- [x] Connecting to the world
|
||||
- [x] Chat
|
||||
- [ ] ABG: (compressed data)
|
||||
- [ ] Decompress data
|
||||
- [x] Decompress data
|
||||
- [ ] Vehicle data
|
||||
- [ ] Players synchronizations
|
||||
- [ ] UDP Server part:
|
||||
- [ ] Players synchronizations
|
||||
- [ ] Ping
|
||||
- [ ] Player counter
|
||||
- [x] Additional:
|
||||
- [x] Events System
|
||||
- [x] Plugins support
|
||||
|
@ -5,6 +5,7 @@
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
import zlib
|
||||
|
||||
from core import utils
|
||||
from .tcp_server import TCPServer
|
||||
@ -87,17 +88,16 @@ class Client:
|
||||
return b""
|
||||
|
||||
data = await self.reader.read(101 * MB)
|
||||
self.log.debug(f"header: `{header}`; int_header: `{int_header}`; data: `{data}`;")
|
||||
|
||||
if len(data) != int_header:
|
||||
self.log.debug(f"WARN Expected to read {int_header} bytes, instead got {len(data)}")
|
||||
|
||||
self.log.debug(f"header: `{header}`; int_header: `{int_header}`; data: `{data}`;")
|
||||
# TODO: ABG: DeComp(Data)
|
||||
abg = b"ABG:"
|
||||
if len(data) > len(abg) and data.startswith(abg):
|
||||
data = data[len(abg):]
|
||||
return b""
|
||||
# return DeComp(Data);
|
||||
data = zlib.decompress(data[len(abg):])
|
||||
self.log.debug(f"ABG: {data}")
|
||||
return data
|
||||
return data
|
||||
|
||||
async def sync_resources(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user