This commit improves the handling of moon phase messages in the game's WebSocket consumer. It corrects the data structure received by the moon_phase method to align with the frontend's expected format, ensuring proper synchronization of moon phase data between the server and client.
Key Changes:
game/consumers.py now correctly unpacks message and moon_data from the incoming data dictionary.
Adjusted the moon_phase method to accept a single data parameter, which contains both the message and moon data, instead of two separate parameters.
Also, Updated game session query to directly use 'game_id' for better clarity and consistency. Implemented user authentication checks in WebSocket consumer for secure action validation. Improved moon phase messaging logic to correctly update player word pools and handle moon phase interpretations, ensuring accurate game state transitions and data integrity.
This commit improves the handling of moon phase messages in the game's WebSocket consumer. It corrects the data structure received by the
moon_phase
method to align with the frontend's expected format, ensuring proper synchronization of moon phase data between the server and client.Key Changes:
game/consumers.py
now correctly unpacksmessage
andmoon_data
from the incoming data dictionary.moon_phase
method to accept a singledata
parameter, which contains both the message and moon data, instead of two separate parameters.Also, Updated game session query to directly use 'game_id' for better clarity and consistency. Implemented user authentication checks in WebSocket consumer for secure action validation. Improved moon phase messaging logic to correctly update player word pools and handle moon phase interpretations, ensuring accurate game state transitions and data integrity.