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

More client lifecycle improvements #4777

Commits on May 14, 2024

  1. Fix handshakes to set states just before sending messages

    Otherwise there is a timing bug where if the client happens to respond quickly and the handshake thread happens to be
    suspended between sending the message and setting the state.
    kwvanderlinde committed May 14, 2024
    Configuration menu
    Copy the full SHA
    d518ce3 View commit details
    Browse the repository at this point in the history
  2. Handshakes are now based on futures

    This removes the need for `HandshakeObserver` as well as most methods on `Handshake`, since the information can now be
    obtained through the future results.
    
    Handshakes also register and unregister themselves as message handlers. This removes the need for `releaseHandshake()`,
    as well as for `MapToolServerConnection` to keep track of handshakes.
    kwvanderlinde committed May 14, 2024
    Configuration menu
    Copy the full SHA
    454fa38 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Enforce a lifecycle for MapToolClient

    The client can now be in one of these states: `New`; `Started`; `Connected`; `Closed`. When transitioning states, we
    check that we are in an acceptable state or otherwise disallow the transition. This ensures that calls like `start()` or
    `stop()` can only be effected once.
    
    ServerCommandClientImpl will now avoid sending messages unless the client state is `Connected`. Among other things, this
    prevents unwanted heartbeats from being sent during handshakes.
    kwvanderlinde committed May 16, 2024
    Configuration menu
    Copy the full SHA
    e4bcb43 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f0abae6 View commit details
    Browse the repository at this point in the history
  3. Remove vestiges of Players change listener

    Instead, the sole observable player database (`PasswordFilePlayerDatabase`) will fire these
    events. `PlayerDatabaseDialogController` is the only listener and now registers directly on the database.
    
    The public API of `Players` has also been reduced, either by privatizing methods or removing trivial wrappers of its
    player database.
    kwvanderlinde committed May 16, 2024
    Configuration menu
    Copy the full SHA
    49b9254 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Fix typo in log message

    kwvanderlinde committed May 17, 2024
    Configuration menu
    Copy the full SHA
    d9ff6ce View commit details
    Browse the repository at this point in the history