From d7eb9071a0c06238d78fc69cb4e21855823e1ed9 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 7 Mar 2018 17:04:48 +0700 Subject: Shrink socket hardcoded msg lengths to 7 --- brutalmaze/game.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'brutalmaze') diff --git a/brutalmaze/game.py b/brutalmaze/game.py index 95d782c..affc4c0 100644 --- a/brutalmaze/game.py +++ b/brutalmaze/game.py @@ -258,13 +258,13 @@ class Game: self.maze.reinit() while True: if self.hero.dead: - connection.send('00000000'.encode()) + connection.send('0000000'.encode()) break data = self.export() - connection.send('{:08}'.format(len(data)).encode()) + connection.send('{:07}'.format(len(data)).encode()) connection.send(data) try: - buf = connection.recv(8) + buf = connection.recv(7) except: # client is likely to be closed break if not buf: break -- cgit 1.4.1