mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2026-02-04 11:40:25 +01:00
fixing some errors
This commit is contained in:
parent
4d69a84bdd
commit
730431736a
@ -244,9 +244,11 @@ class Game:
|
|||||||
if not self.localgame:
|
if not self.localgame:
|
||||||
await self.player2.send(end_message)
|
await self.player2.send(end_message)
|
||||||
if hasattr(self, 'tournament'):
|
if hasattr(self, 'tournament'):
|
||||||
|
print(f"*** Game #{self.game_id} from tournament: {self.tournament.tournoi_reg.name} ENDED ***")
|
||||||
await sync_to_async(handle_game_data)(self.game_state['player1_name'], self.game_state['player2_name'],
|
await sync_to_async(handle_game_data)(self.game_state['player1_name'], self.game_state['player2_name'],
|
||||||
self.game_state['player1_score'], self.game_state['player2_score'],
|
self.game_state['player1_score'], self.game_state['player2_score'],
|
||||||
self.bt1, self.bt2, duration, True, self.tournament.tournoi_reg)
|
self.bt1, self.bt2, duration, True, self.tournament.tournoi_reg)
|
||||||
|
print(f"*** Game #{self.game_id} from tournament: {self.tournament.tournoi_reg.name} is REGISTERED ***")
|
||||||
else:
|
else:
|
||||||
await sync_to_async(handle_game_data)(self.game_state['player1_name'], self.game_state['player2_name'],
|
await sync_to_async(handle_game_data)(self.game_state['player1_name'], self.game_state['player2_name'],
|
||||||
self.game_state['player1_score'], self.game_state['player2_score'],
|
self.game_state['player1_score'], self.game_state['player2_score'],
|
||||||
|
|||||||
@ -10,13 +10,6 @@ from .models import Tournoi
|
|||||||
from .utils import create_tournament, update_tournament, getlen
|
from .utils import create_tournament, update_tournament, getlen
|
||||||
from asgiref.sync import sync_to_async
|
from asgiref.sync import sync_to_async
|
||||||
|
|
||||||
|
|
||||||
TOURNAMENT_NAMES = [
|
|
||||||
"Champions Clash", "Ultimate Showdown", "Battle Royale",
|
|
||||||
"Victory Cup", "Legends Tournament", "Elite Series", "Clash of 42",
|
|
||||||
"Shibuya incident", "Cunning Game", "Elite of the Stars"
|
|
||||||
]
|
|
||||||
|
|
||||||
TOURNAMENT_NAMES = [
|
TOURNAMENT_NAMES = [
|
||||||
"Champion's Clash", "Ultimate Showdown", "Battle Royale",
|
"Champion's Clash", "Ultimate Showdown", "Battle Royale",
|
||||||
"Victory's Cup", "Legends Tournament", "Elite Series", "Clash of 42",
|
"Victory's Cup", "Legends Tournament", "Elite Series", "Clash of 42",
|
||||||
@ -214,6 +207,7 @@ class TournamentMatchMaker:
|
|||||||
self.rounds = []
|
self.rounds = []
|
||||||
self.current_round = 0
|
self.current_round = 0
|
||||||
self.games = 0
|
self.games = 0
|
||||||
|
self.tournament_state = "waiting"
|
||||||
|
|
||||||
async def handle_match_end(self, match):
|
async def handle_match_end(self, match):
|
||||||
await self.update_brackets()
|
await self.update_brackets()
|
||||||
|
|||||||
@ -10,7 +10,9 @@ def handle_game_data(p1, p2, s_p1, s_p2, bt_p1, bt_2, dur, is_tournoi, name_tour
|
|||||||
player_1 = get_or_create_player(p1)
|
player_1 = get_or_create_player(p1)
|
||||||
player_2 = get_or_create_player(p2)
|
player_2 = get_or_create_player(p2)
|
||||||
|
|
||||||
|
print("CHAKU & THEOUCHE are the BEST")
|
||||||
create_match(player_1, player_2, s_p1, s_p2, bt_p1, bt_2, dur, is_tournoi, name_tournament)
|
create_match(player_1, player_2, s_p1, s_p2, bt_p1, bt_2, dur, is_tournoi, name_tournament)
|
||||||
|
print("and ADRIANO is the PEST")
|
||||||
|
|
||||||
update_player_statistics(p1)
|
update_player_statistics(p1)
|
||||||
update_player_statistics(p2)
|
update_player_statistics(p2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user