fix typo variable name. change game requests comment
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# 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):
|
||||
print("no bot")
|
||||
while(Game.WaitingForPlayerLock):
|
||||
while(Game.waitingForPlayerLock):
|
||||
time.sleep(0.05)
|
||||
Game.waitingForPlayerLock = True
|
||||
if(Game.waitingForPlayer == None):
|
||||
|
@ -6,7 +6,7 @@
|
||||
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# 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, ...}}
|
||||
|
||||
#client actions :
|
||||
# 0 : player join : a player joins the game
|
||||
# - id : id of the player who joined
|
||||
# - username : username of the player who joined
|
||||
#server actions (actions sent by the server):
|
||||
# 0 : wait : tell the client to wait for an opponent
|
||||
#
|
||||
# 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
|
||||
# - 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]
|
||||
def gameRequest(socket, content):
|
||||
|
Reference in New Issue
Block a user