Skip to content

Commit

Permalink
Merge pull request #14 from Jaz7Mutant/net
Browse files Browse the repository at this point in the history
major bug fixes
  • Loading branch information
Jaz7Mutant authored May 7, 2019
2 parents 8e18d95 + 04074c3 commit 366d954
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Словари `dictionaries/`

Справка: `python TypingTrainer.py --help`

Запуск игры: `python TypingTrainer.py`

## Режимы игры
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
colorama==0.4.1
websocket-client==0.56.0
16 changes: 9 additions & 7 deletions typetrainer/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ def get_rooms(data):
if int(room_number) >= counter:
print('Incorrect room')
time.sleep(0.5)
# multiplayer_menu.WAITING_FOR_RESPONSE = False
multiplayer_menu.WAITING_FOR_RESPONSE = False
# TODO Check multiplayer
return
password = input('Password: ')
room_join(int(room_number) - 1, password, menu.get_user_name(False))
# multiplayer_menu.WAITING_FOR_RESPONSE = False
time.sleep(0.8)
multiplayer_menu.WAITING_FOR_RESPONSE = False


@sio.on("joined")
Expand Down Expand Up @@ -229,11 +230,11 @@ def get_players(data):
counter = 0
for player in data['players']:
if counter == 0:
print('%s. %-16s L' % (counter, player))
# print(str(counter) + '. ' + player + ' L')
# print('%s. %-16s L' % (counter, player))
print(str(counter) + '. ' + player + ' L')
else:
print('%s. %-16s' % player)
# print(str(counter) + '. ' + player)
# print('%s. %-16s' % player)
print(str(counter) + '. ' + player)
# TODO Check
counter += 1
elif data['err'] == 401:
Expand Down Expand Up @@ -267,7 +268,8 @@ def room_list():
Ответ приходит в get_rooms()
"""
sio.emit("rooms")
multiplayer_menu.WAITING_FOR_RESPONSE = False
# time.sleep(1)
# multiplayer_menu.WAITING_FOR_RESPONSE = False


def room_join(index: int, password: str, username: str):
Expand Down

0 comments on commit 366d954

Please sign in to comment.