fix small errors in move requests

This commit is contained in:
2024-09-16 14:21:49 +02:00
parent 52faeaf81c
commit ea9bff1382
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@
# By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/09/13 16:20:58 by tomoron #+# #+# #
# Updated: 2024/09/16 14:03:03 by tomoron ### ########.fr #
# Updated: 2024/09/16 14:16:03 by tomoron ### ########.fr #
# #
# **************************************************************************** #
@ -92,7 +92,7 @@ class Game:
self.p2.sync_send(data_raw)
def move(self, socket, pos, up):
opponent = p1 if socket != p1 else p2
opponent = self.p1 if socket != self.p1 else self.p2
opponent.sync_send({"type":"game","content":{"action":3, "pos":pos, "up":up}})
async def gameLoop(self):

View File

@ -6,13 +6,13 @@
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/09/16 13:54:55 by tomoron #+# #+# #
# Updated: 2024/09/16 14:03:09 by tomoron ### ########.fr #
# Updated: 2024/09/16 14:18:04 by tomoron ### ########.fr #
# #
# **************************************************************************** #
def move(socket, content):
async def move(socket, content):
up = content.get("up", False)
pos = content.get("pos", None)
if(pos == None):
return;
socket.game.move(socket, up, pos)
socket.game.move(socket, pos, up)