1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add register dialog to separate login/register (#12185)

New users find Minetest's account system confusing.
This change moves username/password to a new dialog,
with login and register buttons added to the Join Game tab.

The old registration confirmation dialog is removed in
favour of the new dialog.

Fixes #8138
This commit is contained in:
rubenwardy 2022-06-05 16:47:38 +01:00 committed by GitHub
parent 21323ef1ff
commit 03d86ea0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 232 additions and 402 deletions

View file

@ -100,7 +100,8 @@ Client::Client(
MtEventManager *event,
RenderingEngine *rendering_engine,
bool ipv6,
GameUI *game_ui
GameUI *game_ui,
ELoginRegister allow_login_or_register
):
m_tsrc(tsrc),
m_shsrc(shsrc),
@ -124,7 +125,8 @@ Client::Client(
m_media_downloader(new ClientMediaDownloader()),
m_state(LC_Created),
m_game_ui(game_ui),
m_modchannel_mgr(new ModChannelMgr())
m_modchannel_mgr(new ModChannelMgr()),
m_allow_login_or_register(allow_login_or_register)
{
// Add local player
m_env.setLocalPlayer(new LocalPlayer(this, playername));
@ -396,10 +398,6 @@ void Client::step(float dtime)
initial_step = false;
}
else if(m_state == LC_Created) {
if (m_is_registration_confirmation_state) {
// Waiting confirmation
return;
}
float &counter = m_connection_reinit_timer;
counter -= dtime;
if(counter <= 0.0) {
@ -1078,18 +1076,6 @@ void Client::sendInit(const std::string &playerName)
Send(&pkt);
}
void Client::promptConfirmRegistration(AuthMechanism chosen_auth_mechanism)
{
m_chosen_auth_mech = chosen_auth_mechanism;
m_is_registration_confirmation_state = true;
}
void Client::confirmRegistration()
{
m_is_registration_confirmation_state = false;
startAuth(m_chosen_auth_mech);
}
void Client::startAuth(AuthMechanism chosen_auth_mechanism)
{
m_chosen_auth_mech = chosen_auth_mechanism;