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

Add: [Network] Keep the refresh button in lowered state while refreshing #9600

Merged
merged 1 commit into from Oct 3, 2021

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

I noticed on the Game Coordinator usage statistics, that we see a lot of "Aborted" connections. This happens when a new connection to the same server is being created while another one is still pending. Initially I couldn't figure out when this happens, till I was looking into an unrelated but in the Game Coordinator:

Especially when you have a TURN-connection, one that doesn't allow STUN, refreshing a server takes a few seconds. There is no visual feedback in this GUI to tell you the refresh is still pending, as the button goes up directly after pressing it. This gives you the idea you misclicked or something else went wrong, so you press again. And again. And again.

This PR sets out to resolve this.

As written in the commit message:

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.

Description

Simply track that the server is being refreshed, and keep the state lowered while this holds true. Additionally, prevent clicking on the button again to give a pretty solid UX experience.

retries wasn't used anymore, so I removed that variable while I was at it.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TrueBrain TrueBrain added the backport requested This PR should be backport to current release (RC / stable) label Oct 3, 2021
@TrueBrain TrueBrain merged commit e4ad632 into OpenTTD:master Oct 3, 2021
@TrueBrain TrueBrain deleted the refresh-button branch October 3, 2021 09:02
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Oct 3, 2021
…ing (OpenTTD#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Oct 3, 2021
…ing (OpenTTD#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Oct 3, 2021
…ing (OpenTTD#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Oct 3, 2021
…ing (OpenTTD#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Oct 3, 2021
…ing (OpenTTD#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
TrueBrain added a commit that referenced this pull request Oct 3, 2021
…ing (#9600)

This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
@TrueBrain TrueBrain removed the backport requested This PR should be backport to current release (RC / stable) label Oct 3, 2021
@LordAro LordAro added the backported This PR is backported to a current release (RC / stable) label Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants