Skip to content

Commit

Permalink
Arreglo de envio de mensajes al jugar seducción
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeluduena committed Nov 11, 2023
1 parent c71ac7b commit 7956e28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/routers/games/action_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async def send_players_chagnge_event(game: Game, player_id: int, objective_playe
async def send_players_exchagnge_event(game: Game, player_id: int, objective_player_id: int):
json_msg = {
"event": Events.EXCHANGE_DONE,
"player_id": player_id,
"objective_player_id": objective_player_id
"player_name": get_player_name_by_id(player_id),
"objective_player_name": get_player_name_by_id(objective_player_id)
}
await player_connections.send_event_to_other_players_in_game(game.name, json_msg, player_id)

Expand Down Expand Up @@ -186,9 +186,6 @@ def process_card_exchange(game: Game, player: Player, objective_player: Player,
objective_player.hand.remove(objective_player_card)
objective_player.hand.add(player_card)

asyncio.ensure_future(send_players_exchagnge_event(
game, player.id, objective_player.id))


@db_session
def process_seduction_card(game: Game, player: Player, objective_player: Player,
Expand All @@ -201,5 +198,8 @@ def process_seduction_card(game: Game, player: Player, objective_player: Player,
process_card_exchange(game, player, objective_player,
card_to_exchange, random_card)

asyncio.ensure_future(send_players_exchagnge_event(
game, player.id, objective_player.id))

# asyncio.ensure_future(send_seduction_done_event(
# player.id, objective_player.id))

0 comments on commit 7956e28

Please sign in to comment.