chore: 添加虚拟环境到仓库
- 添加 backend_service/venv 虚拟环境 - 包含所有Python依赖包 - 注意:虚拟环境约393MB,包含12655个文件
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import msgpack
|
||||
from . import packet
|
||||
|
||||
|
||||
class MsgPackPacket(packet.Packet):
|
||||
uses_binary_events = False
|
||||
|
||||
def encode(self):
|
||||
"""Encode the packet for transmission."""
|
||||
return msgpack.dumps(self._to_dict())
|
||||
|
||||
def decode(self, encoded_packet):
|
||||
"""Decode a transmitted package."""
|
||||
decoded = msgpack.loads(encoded_packet)
|
||||
self.packet_type = decoded['type']
|
||||
self.data = decoded.get('data')
|
||||
self.id = decoded.get('id')
|
||||
self.namespace = decoded['nsp']
|
||||
Reference in New Issue
Block a user