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

Cleanup ClientLauncher #10160

Merged
merged 7 commits into from Jul 14, 2020
Merged

Cleanup ClientLauncher #10160

merged 7 commits into from Jul 14, 2020

Conversation

SmallJoker
Copy link
Member

ClientLauncher handles the client-relevant CLI arguments and main menu information to start a client.
This PR now removes duplicated variables and unifies the startup data into a new (inherited) struct. It's still a mess, but I hope this goes into the right direction.

Features:

  • Easier to join singleplayer worlds (see examples below)

Fixes #8273 as a side-effect.

To do

This PR is Ready for Review.

How to test

# Singleplayer
minetest --go --worldname WORLDNAME

# Singleplayer: Ignored name input
minetest --go --worldname WORLDNAME --name foobar

# Remote server
minetest --go --address daconcepts.com --port 30001 --name Krock --password hunter2

# Remote server: Port and login from minetest.conf
minetest --go --address daconcepts.com

# Local server
minetest --server --worldname WORLDNAME --port 30001

# Local server: Port from minetest.conf
minetest --server --worldname WORLDNAME

Plus all main menu functions:

  • Local server
  • Singleplayer
  • Join remote server

src/main.cpp Show resolved Hide resolved
@sfan5
Copy link
Member

sfan5 commented Jul 13, 2020

In file included from .../minetest/src/client/clientlauncher.cpp:33:
.../minetest/src/client/clientlauncher.h:55:17: warning: private field 'font' is not used [-Wunused-private-field]
        gui::IGUIFont *font = nullptr;
                       ^
.../minetest/src/client/game.cpp:879:7: warning: private field 'random_input' is not used [-Wunused-private-field]
        bool random_input;
             ^

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

Works.

@SmallJoker SmallJoker merged commit 4fa1e03 into minetest:master Jul 14, 2020
@shacknetisp
Copy link
Contributor

Is there a way with this cleanup to run a local game with a specific player name?

Previous I could use something like: minetest --go --worldname someworld --name beha --address "" to use the player beha instead of singleplayer

Now I get the error: ERROR[Main]: No world selected and no address provided. Nothing to do.

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

Successfully merging this pull request may close these issues.

Error on exit from main menu.
3 participants