fix typo variable name. change game requests comment

This commit is contained in:
2024-09-14 12:44:34 +02:00
parent 92ff0e9e8d
commit c9cb82c91f
2 changed files with 14 additions and 10 deletions

View File

@ -6,7 +6,7 @@
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ # # By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2024/09/13 16:20:58 by tomoron #+# #+# # # Created: 2024/09/13 16:20:58 by tomoron #+# #+# #
# Updated: 2024/09/14 00:40:30 by tomoron ### ########.fr # # Updated: 2024/09/14 12:01:35 by tomoron ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -26,7 +26,7 @@ class Game:
if(not withBot): if(not withBot):
print("no bot") print("no bot")
while(Game.WaitingForPlayerLock): while(Game.waitingForPlayerLock):
time.sleep(0.05) time.sleep(0.05)
Game.waitingForPlayerLock = True Game.waitingForPlayerLock = True
if(Game.waitingForPlayer == None): if(Game.waitingForPlayer == None):

View File

@ -6,7 +6,7 @@
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ # # By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2024/09/09 16:10:26 by tomoron #+# #+# # # Created: 2024/09/09 16:10:26 by tomoron #+# #+# #
# Updated: 2024/09/13 23:41:52 by tomoron ### ########.fr # # Updated: 2024/09/14 12:43:14 by tomoron ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -15,18 +15,22 @@ from .gameActions.ready import ready
# game request format : {"type":"game", "content":{"action": 1, ...}} # game request format : {"type":"game", "content":{"action": 1, ...}}
#client actions : #server actions (actions sent by the server):
# 0 : player join : a player joins the game # 0 : wait : tell the client to wait for an opponent
# - id : id of the player who joined
# - username : username of the player who joined
# #
# 1 : ... # 1 : opponent : tell the client the name of the opponent
# - id
# - username
#
# 2 : go : the game started
#server actions : #client actions (actions sent by the client) :
# 0 : start : starts a game # 0 : start : starts a game
# - with_bot : true/false, is the second player a bot # - with_bot : true/false, is the second player a bot
# #
# 1 : ready : tell the server the game is ready to start (after count down) # 1 : ready : tell the server the game is ready to start
#
# 2 : leave : leave the game (or waiting screen)
action_list = [start, ready] action_list = [start, ready]
def gameRequest(socket, content): def gameRequest(socket, content):