Commit 22434ef5 authored by nanahira's avatar nanahira

Revert "fix"

This reverts commit 759eccfe.
parent 4e24aafb
Pipeline #37918 passed with stages
in 24 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,9 +286,7 @@ async def handle_client(reader: StreamReader, writer: StreamWriter): ...@@ -286,9 +286,7 @@ async def handle_client(reader: StreamReader, writer: StreamWriter):
return return
dst.write(header) dst.write(header)
dst.write(payload) dst.write(payload)
if not (direction == 'CTOS' and packet_id == CTOS_UPDATE_DECK): await dst.drain()
# 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