Website with a real-time multiplayer Pong contest with Python (Django) backend, JavaScript (Bootstrap Toolkit) frontend, and various modules for enhanced features like tournaments, blockchain integration, AI opponents, and more.
Problem: Stats are saved based on the user's display name, which the host can change, leading to incorrect stat recording.
Proposed Solution: Use a new player data structure to handle player information more reliably.
player = {
displayName: string, // Display name in game
username: string, // Username if host
isHost: boolean, // Host flag
isAi: boolean // AI flag
};
Implementation: Due to refactoring issues, this structure isn't used throughout the code so I added a new field "PlayerInfo" in the backend data to not mess up other features:
Problem: Stats are saved based on the user's display name, which the host can change, leading to incorrect stat recording.
Proposed Solution: Use a new player data structure to handle player information more reliably.
Implementation: Due to refactoring issues, this structure isn't used throughout the code so I added a new field "PlayerInfo" in the backend data to not mess up other features:
Request: @pedperei, please update the stat-saving logic in the match-history endpoint to use this new Player object.