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

Feature: make "join game" button join the game, instead of first showing a lobby window #9467

Merged
merged 1 commit into from Aug 14, 2021

Conversation

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Aug 10, 2021

Motivation / Problem

(part of commit message)

Nobody really paid attention to the lobby window, and it completely
missed its purpose. Most people don't even wait for companies to
show up, but just hit "New Company".
This in turn means people create a lot of unneeded companies, while
they "just want to watch the game" or join another company.

Description

(part of commit message)

Instead, "Join Game" now just joins the game as spectators.

A future PR will address the gap that now exists between: I joined a server, now how to start playing?

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 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')
@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from a2bb8d3 to d748e98 Aug 10, 2021
Copy link
Contributor

@rubidium42 rubidium42 left a comment

Can't the server side be simplified as well? Practically not implementing Receive_CLIENT_COMPANY_INFO (and letting tcp_game's implementation take over) would be possible since the lobby should never be shown without going through the game list which prevents connecting to a server with the wrong version, right?
Alternatively sending SERVER_COMPANY_INFO (SendCompanyInfo) gets heavily simplified by just sending a packet with that type and a new version number and a false boolean. Then the protocol is not closing the client's connection, but the client gets nothing except an unexpected version which is to be expected when you send a newer version. Although that might ofcourse cause whining from some people that you cannot acquire that information anymore, but alas... they should be using the admin protocol instead I guess.
I can imagine postponing this can of worms to a separate PR though.

Loading

src/network/network_client.cpp Show resolved Hide resolved
Loading
src/window_type.h Show resolved Hide resolved
Loading
@TrueBrain
Copy link
Member Author

@TrueBrain TrueBrain commented Aug 10, 2021

Can't the server side be simplified as well? Practically not implementing Receive_CLIENT_COMPANY_INFO (and letting tcp_game's implementation take over) would be possible since the lobby should never be shown without going through the game list which prevents connecting to a server with the wrong version, right?
Alternatively sending SERVER_COMPANY_INFO (SendCompanyInfo) gets heavily simplified by just sending a packet with that type and a new version number and a false boolean. Then the protocol is not closing the client's connection, but the client gets nothing except an unexpected version which is to be expected when you send a newer version. Although that might ofcourse cause whining from some people that you cannot acquire that information anymore, but alas... they should be using the admin protocol instead I guess.
I can imagine postponing this can of worms to a separate PR though.

As with the other comment, these packets are part of the "we never going to change this" group. I am in no mood to look into that any further :P So possibly you are right .. but yeah, not for this PR :)

Edit: I created #9475 to address this.

Loading

@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from d748e98 to ca5e508 Aug 10, 2021
@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from ca5e508 to a39cd7d Aug 10, 2021
@LordAro LordAro changed the title Feature: make "join game" button join the game, instead of first showing a lobby window Feature: make "join game" button join the game, instead of first showing a lobby window Aug 10, 2021
@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from a39cd7d to 4d692eb Aug 13, 2021
@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from 4d692eb to ab3c0ab Aug 14, 2021
@TrueBrain TrueBrain added this to the 1.12 milestone Aug 14, 2021
@@ -38,7 +38,7 @@ enum PacketGameType {
PACKET_CLIENT_JOIN, ///< The client telling the server it wants to join.
PACKET_SERVER_ERROR, ///< Server sending an error message to the client.

/* Packets used for the pre-game lobby. */
/* Packets used for the pre-game lobby (unused, but remain for backward/forward compatibility). */
PACKET_CLIENT_COMPANY_INFO, ///< Request information about all companies.
Copy link
Member

@frosch123 frosch123 Aug 14, 2021

Choose a reason for hiding this comment

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

maybe add a "_UNUSED" to the constants themself?

Loading

Copy link
Member Author

@TrueBrain TrueBrain Aug 14, 2021

Choose a reason for hiding this comment

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

To give that change a bit more visibility, I did that in #9475 .

Loading

src/script/api/game_changelog.hpp Outdated Show resolved Hide resolved
Loading
…ing a lobby window

Nobody really paid attention to the lobby window, and it completely
missed its purpose. Most people don't even wait for companies to
show up, but just hit "New Company".
This in turn means people create a lot of unneeded companies, while
they "just want to watch the game" or join another company.

Instead, "Join Game" now just joins the game as spectators.
@TrueBrain TrueBrain force-pushed the remove-lobby-window branch from ab3c0ab to c26ed4c Aug 14, 2021
@TrueBrain TrueBrain merged commit 3d55ea2 into OpenTTD:master Aug 14, 2021
15 checks passed
Loading
@TrueBrain TrueBrain deleted the remove-lobby-window branch Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants