88from ttt .application .game .game .ports .game_log import GameLog
99from ttt .application .game .game .ports .game_views import GameViews
1010from ttt .application .game .game .ports .games import Games
11- from ttt .application .matchmaking_queue .common .matchmaking_queue_log import (
12- CommonMatchmakingQueueLog ,
11+ from ttt .application .matchmaking .common .matchmaking_log import (
12+ CommonMatchmakingLog ,
1313)
14- from ttt .application .matchmaking_queue .common .matchmaking_queue_views import (
15- CommonMatchmakingQueueViews ,
14+ from ttt .application .matchmaking .common .matchmaking_views import (
15+ CommonMatchmakingViews ,
1616)
17- from ttt .application .matchmaking_queue .common .shared_matchmaking_queue import (
18- SharedMatchmakingQueue ,
17+ from ttt .application .matchmaking .common .shared_matchmaking import (
18+ SharedMatchmaking ,
1919)
2020from ttt .application .user .common .ports .user_views import CommonUserViews
2121from ttt .application .user .common .ports .users import Users
22- from ttt .entities .core .matchmaking_queue . matchmaking_queue import (
22+ from ttt .entities .core .matchmaking . matchmaking import (
2323 UserAlreadyWaitingForGameError ,
2424)
2525from ttt .entities .core .user .user import UserAlreadyInGameError
@@ -38,9 +38,9 @@ class WaitGame:
3838 games : Games
3939 game_views : GameViews
4040 game_log : GameLog
41- shared_matchmaking_queue : SharedMatchmakingQueue
42- matchmaking_queue_views : CommonMatchmakingQueueViews
43- matchmaking_queue_log : CommonMatchmakingQueueLog
41+ shared_matchmaking : SharedMatchmaking
42+ matchmaking_views : CommonMatchmakingViews
43+ matchmaking_log : CommonMatchmakingLog
4444
4545 async def __call__ (self , user_id : int ) -> None :
4646 async with self .transaction :
@@ -50,7 +50,7 @@ async def __call__(self, user_id: int) -> None:
5050 await self .user_views .user_is_not_registered_view (user_id )
5151 return
5252
53- matchmaking_queue = await self .shared_matchmaking_queue
53+ matchmaking = await self .shared_matchmaking
5454 user_waiting_id = await self .uuids .random_uuid ()
5555 game_id = await self .uuids .random_uuid ()
5656 cell_id_matrix = await self .uuids .random_uuid_matrix ((3 , 3 ))
@@ -60,7 +60,7 @@ async def __call__(self, user_id: int) -> None:
6060
6161 try :
6262 tracking = Tracking ()
63- game = matchmaking_queue . add_user (
63+ game = matchmaking . wait_game (
6464 user ,
6565 user_waiting_id ,
6666 cell_id_matrix ,
@@ -71,24 +71,24 @@ async def __call__(self, user_id: int) -> None:
7171 tracking ,
7272 )
7373 except UserAlreadyWaitingForGameError :
74- await self .matchmaking_queue_log .double_waiting_for_game_start (
74+ await self .matchmaking_log .double_waiting_for_game_start (
7575 user_id ,
7676 )
77- await self .matchmaking_queue_views .double_waiting_for_game_view (
77+ await self .matchmaking_views .double_waiting_for_game_view (
7878 user_id ,
7979 )
8080 except UserAlreadyInGameError :
8181 await (
82- self .matchmaking_queue_log
83- .user_already_in_game_to_add_to_matchmaking_queue (user_id )
82+ self .matchmaking_log
83+ .user_already_in_game_to_wait_game_in_matchmaking (user_id )
8484 )
8585 await self .game_views .user_already_in_game_view (user_id )
8686 else :
8787 if game is None :
88- await self .matchmaking_queue_log .waiting_for_game_start (
88+ await self .matchmaking_log .waiting_for_game_start (
8989 user_id ,
9090 )
91- await self .matchmaking_queue_views .waiting_for_game_view (
91+ await self .matchmaking_views .waiting_for_game_view (
9292 user_id ,
9393 )
9494 await self .map_ (tracking )
0 commit comments