Merge branch 'main' of github.com:Kum1ta/PTME_Transcendence
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
# By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ #
|
# By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2024/10/04 17:17:07 by tomoron #+# #+# #
|
# Created: 2024/10/04 17:17:07 by tomoron #+# #+# #
|
||||||
# Updated: 2024/10/22 16:32:35 by tomoron ### ########.fr #
|
# Updated: 2024/11/14 14:35:32 by tomoron ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@ -29,6 +29,7 @@ class Tournament:
|
|||||||
self.history = []
|
self.history = []
|
||||||
self.nbBot = nbBot
|
self.nbBot = nbBot
|
||||||
self.end = False
|
self.end = False
|
||||||
|
self.started = False
|
||||||
self.genCode()
|
self.genCode()
|
||||||
Tournament.currentTournaments[self.code] = self
|
Tournament.currentTournaments[self.code] = self
|
||||||
self.join(socket, skin, goal)
|
self.join(socket, skin, goal)
|
||||||
@ -73,8 +74,8 @@ class Tournament:
|
|||||||
index = self.playerFromSocket(socket)
|
index = self.playerFromSocket(socket)
|
||||||
if(index == -1):
|
if(index == -1):
|
||||||
return;
|
return;
|
||||||
self.players.pop(index)
|
|
||||||
socket.tournament = None
|
socket.tournament = None
|
||||||
|
self.players.pop(index)
|
||||||
self.broadcast({"action":2,"id":index})
|
self.broadcast({"action":2,"id":index})
|
||||||
|
|
||||||
def join(self, socket, skin=0, goal=0, isBot=False):
|
def join(self, socket, skin=0, goal=0, isBot=False):
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2024/10/22 01:37:00 by tomoron #+# #+# #
|
# Created: 2024/10/22 01:37:00 by tomoron #+# #+# #
|
||||||
# Updated: 2024/10/22 01:37:12 by tomoron ### ########.fr #
|
# Updated: 2024/11/14 13:59:35 by tomoron ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ class TournamentGame:
|
|||||||
print("waiting for player")
|
print("waiting for player")
|
||||||
nbLoop += 1
|
nbLoop += 1
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
if(not l.socket.online or not r.socket.online):
|
if(not l.socket.tournament == self.tournament or not r.socket.tournament == self.tournament):
|
||||||
print("player is not online, opponent is winner")
|
print("player is not online, opponent is winner")
|
||||||
self.winner = l if l.socket.online else r
|
self.winner = l if l.socket.online else r
|
||||||
return;
|
return;
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<title>Chat</title>
|
<title>Chat</title>
|
||||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
<link rel='stylesheet' type='text/css' href='/static/style/homePage/home.css'>
|
<link rel='stylesheet' type='text/css' href='/static/style/homePage/home.css'>
|
||||||
|
Reference in New Issue
Block a user