diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-03-07 17:04:48 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-03-07 17:04:48 +0700 |
commit | d7eb9071a0c06238d78fc69cb4e21855823e1ed9 (patch) | |
tree | 54236fb7b7fdc4415428e17fafcc0c2629b8d5ed | |
parent | 5fa4eac9a85cced5d7d8c742b0fb9efde50b836f (diff) | |
download | brutalmaze-d7eb9071a0c06238d78fc69cb4e21855823e1ed9.tar.gz |
Shrink socket hardcoded msg lengths to 7
-rw-r--r-- | brutalmaze/game.py | 6 | ||||
m--------- | wiki | 0 |
2 files changed, 3 insertions, 3 deletions
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 diff --git a/wiki b/wiki -Subproject 1b8020f4d1343c582fb3b202048db2b61be2938 +Subproject 172d7d268f9bb3bd3c90e3f52c7d118ab292197 |