Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Make multiplayer connection non-blocking and improve logging. #127

Closed
wants to merge 0 commits into from

Conversation

TomPlanche
Copy link
Contributor

[FIX] Make multiplayer connection non-blocking and improve logging.

Description

This PR addresses an issue where the game would become unresponsive during multiplayer connection setup. The main changes:

  1. Made the multiplayer connection process non-blocking by:

    • Converting wait_for_game_start to use non-blocking socket mode
    • Properly handling connection states in the main loop
    • Adding proper error handling and recovery
  2. Improved logging system by:

    • Adjusting log levels for better signal-to-noise ratio
    • Adding more detailed debug logs around critical paths
    • Cleaning up noisy routine logs while preserving important info

How Has This Been Tested?

The changes have been tested through:

  • Multiplayer host connection flow

    • Start game as host
    • Verify UI remains responsive while waiting
    • Confirm connection succeeds when client joins
  • Multiplayer client connection flow

    • Join existing game
    • Verify UI remains responsive during connection
    • Confirm proper game start
  • Error handling

    • Test connection failures
    • Verify proper error logging
    • Confirm UI remains usable after errors
  • Logging system

    • Verified logs at different levels
    • Confirmed critical events are logged
    • Checked log file output format

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
    • Updated logging configuration docs
    • Added multiplayer connection details
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant