#include "network/networkpacket.h"
#include "threading/mutex_auto_lock.h"
#include "client/clientevent.h"
+#include "client/gameui.h"
#include "client/renderingengine.h"
#include "client/tile.h"
#include "util/auth.h"
IWritableTextureSource *tsrc,
IWritableShaderSource *shsrc,
IWritableItemDefManager *itemdef,
- IWritableNodeDefManager *nodedef,
+ NodeDefManager *nodedef,
ISoundManager *sound,
MtEventManager *event,
bool ipv6,
- GameUIFlags *game_ui_flags
+ GameUI *game_ui
):
m_tsrc(tsrc),
m_shsrc(shsrc),
m_chosen_auth_mech(AUTH_MECHANISM_NONE),
m_media_downloader(new ClientMediaDownloader()),
m_state(LC_Created),
- m_game_ui_flags(game_ui_flags),
+ m_game_ui(game_ui),
m_modchannel_mgr(new ModChannelMgr())
{
// Add local player
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) {
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;
if (g_settings->getBool("enable_client_modding")) {
m_script->on_client_ready(m_env.getLocalPlayer());
- m_script->on_connect();
}
text = wgettext("Done!");
m_client_event_queue.push(event);
}
-void Client::showGameChat(const bool show)
-{
- m_game_ui_flags->show_chat = show;
-}
-
-void Client::showGameHud(const bool show)
-{
- m_game_ui_flags->show_hud = show;
-}
-
void Client::showMinimap(const bool show)
{
- m_game_ui_flags->show_minimap = show;
-}
-
-void Client::showProfiler(const bool show)
-{
- m_game_ui_flags->show_profiler_graph = show;
-}
-
-void Client::showGameFog(const bool show)
-{
- m_game_ui_flags->force_fog_off = !show;
-}
-
-void Client::showGameDebug(const bool show)
-{
- m_game_ui_flags->show_debug = show;
+ m_game_ui->showMinimap(show);
}
// IGameDef interface
{
return m_itemdef;
}
-INodeDefManager* Client::getNodeDefManager()
+const NodeDefManager* Client::getNodeDefManager()
{
return m_nodedef;
}