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')

Copy link
Contributor

@rubidium42 rubidium42 left a comment

Choose a reason for hiding this comment

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

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.

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

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.

@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 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

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?

Copy link
Member Author

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 .

src/script/api/game_changelog.hpp Outdated Show resolved Hide resolved
…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.
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.

None yet

3 participants