Commit 759eccfe authored by nanahira's avatar nanahira

fix

parent 8ef0f9c9
Pipeline #37914 passed with stages
in 43 seconds
...@@ -65,7 +65,7 @@ def prepare_message(proto: int, data: bytes): ...@@ -65,7 +65,7 @@ def prepare_message(proto: int, data: bytes):
length = len(data) + 1 # +1 for the packet type byte length = len(data) + 1 # +1 for the packet type byte
return struct.pack('<H', length) + bytes([proto]) + data return struct.pack('<H', length) + bytes([proto]) + data
CTOS_UPDATE_DECK = 0x2
CTOS_PLAYER_INFO = 0x10 CTOS_PLAYER_INFO = 0x10
CTOS_JOIN_GAME = 0x12 CTOS_JOIN_GAME = 0x12
CTOS_EXTERNAL_ADDRESS = 0x17 CTOS_EXTERNAL_ADDRESS = 0x17
...@@ -286,7 +286,9 @@ async def handle_client(reader: StreamReader, writer: StreamWriter): ...@@ -286,7 +286,9 @@ async def handle_client(reader: StreamReader, writer: StreamWriter):
return return
dst.write(header) dst.write(header)
dst.write(payload) dst.write(payload)
await dst.drain() if not (direction == 'CTOS' and packet_id == CTOS_UPDATE_DECK):
# no drain after CTOS_UPDATE_DECK, because it's expected to glue with CTOS_READY
await dst.drain()
except Exception as e: except Exception as e:
logger.warning(f"Error in pipe {direction} for {player_descriptor}: {e}") logger.warning(f"Error in pipe {direction} for {player_descriptor}: {e}")
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment