Removed CurrentUser usage from all files except PlayerManager
and PlayerProfile.
This commit is contained in:
parent
1a908b254f
commit
447ca89c0a
@ -25,7 +25,6 @@
|
||||
#include "config/player_profile.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
@ -83,6 +83,72 @@ PlayerManager::OnlineState PlayerManager::getCurrentOnlineState()
|
||||
{
|
||||
return (OnlineState)getCurrentUser()->getUserState();
|
||||
} // getCurrentOnlineState
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Returns the online name of this player.
|
||||
*/
|
||||
const irr::core::stringw& PlayerManager::getCurrentOnlineUserName()
|
||||
{
|
||||
if (getCurrentOnlineState() == OS_SIGNED_IN ||
|
||||
getCurrentOnlineState() == OS_GUEST )
|
||||
return getCurrentOnlineProfile()->getUserName();
|
||||
|
||||
static core::stringw not_signed_in = _("Currently not signed in");
|
||||
return not_signed_in;
|
||||
} // getCurrentOnlineUserName
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Sends a request to the server to see if any new information is
|
||||
* available. (online friends, notifications, etc.).
|
||||
*/
|
||||
void PlayerManager::requestOnlinePoll()
|
||||
{
|
||||
getCurrentUser()->requestPoll();
|
||||
} // requestOnlinePoll
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Reconnect to the server using the saved session data.
|
||||
*/
|
||||
void PlayerManager::resumeSavedSession()
|
||||
{
|
||||
getCurrentUser()->requestSavedSession();
|
||||
} // resumeSavedSession
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Sends a message to the server that the client has been closed, if a
|
||||
* user is signed in.
|
||||
*/
|
||||
void PlayerManager::onSTKQuit()
|
||||
{
|
||||
getCurrentUser()->onSTKQuit();
|
||||
} // onSTKQuit
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Create a signin request.
|
||||
* \param username Name of user.
|
||||
* \param password Password.
|
||||
* \param save_session If true, the login credential will be saved to
|
||||
* allow a password-less login.
|
||||
* \param request_now Immediately submit this request to the
|
||||
* RequestManager.
|
||||
*/
|
||||
|
||||
Online::XMLRequest *PlayerManager::requestSignIn(const irr::core::stringw &username,
|
||||
const irr::core::stringw &password,
|
||||
bool save_session,
|
||||
bool request_now)
|
||||
{
|
||||
return getCurrentUser()->requestSignIn(username, password, save_session,
|
||||
request_now);
|
||||
} // requestSignIn
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Signs the current user out.
|
||||
*/
|
||||
void PlayerManager::requestSignOut()
|
||||
{
|
||||
getCurrentUser()->requestSignOut();
|
||||
} // requestSignOut
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Returns the current online profile (which is the list of all achievements
|
||||
* and friends).
|
||||
|
@ -36,6 +36,7 @@ namespace Online
|
||||
class CurrentUser;
|
||||
class HTTPRequest;
|
||||
class OnlineProfile;
|
||||
class XMLRequest;
|
||||
}
|
||||
class PlayerProfile;
|
||||
|
||||
@ -113,6 +114,15 @@ public:
|
||||
};
|
||||
|
||||
static OnlineState getCurrentOnlineState();
|
||||
static const irr::core::stringw& getCurrentOnlineUserName();
|
||||
static void requestOnlinePoll();
|
||||
static void resumeSavedSession();
|
||||
static void onSTKQuit();
|
||||
static void requestSignOut();
|
||||
static Online::XMLRequest *requestSignIn(const irr::core::stringw &username,
|
||||
const irr::core::stringw &password,
|
||||
bool save_session,
|
||||
bool request_now = true);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the current player. */
|
||||
@ -125,6 +135,7 @@ public:
|
||||
{
|
||||
return get()->m_current_player->getCurrentUser();
|
||||
} // getCurrentUser
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
PlayerProfile *getPlayer(const irr::core::stringw &name);
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -39,7 +39,7 @@ PlayerProfile::PlayerProfile(const core::stringw& name, bool is_guest)
|
||||
#ifdef DEBUG
|
||||
m_magic_number = 0xABCD1234;
|
||||
#endif
|
||||
m_name = name;
|
||||
m_local_name = name;
|
||||
m_is_guest_account = is_guest;
|
||||
m_use_frequency = is_guest ? -1 : 0;
|
||||
m_unique_id = PlayerManager::get()->getUniqueId();
|
||||
@ -76,7 +76,7 @@ PlayerProfile::PlayerProfile(const XMLNode* node)
|
||||
m_achievements_status = NULL;
|
||||
m_current_user = new Online::CurrentUser();
|
||||
|
||||
node->get("name", &m_name );
|
||||
node->get("name", &m_local_name );
|
||||
node->get("guest", &m_is_guest_account);
|
||||
node->get("use-frequency", &m_use_frequency );
|
||||
node->get("unique-id", &m_unique_id );
|
||||
@ -132,7 +132,7 @@ void PlayerProfile::initRemainingData()
|
||||
*/
|
||||
void PlayerProfile::save(UTFWriter &out)
|
||||
{
|
||||
out << L" <player name=\"" << m_name
|
||||
out << L" <player name=\"" << m_local_name
|
||||
<< L"\" guest=\"" << m_is_guest_account
|
||||
<< L"\" use-frequency=\"" << m_use_frequency << L"\"\n";
|
||||
|
||||
|
@ -47,7 +47,7 @@ private:
|
||||
|
||||
/** The name of the player (wide string, so it can be in native
|
||||
* language). */
|
||||
core::stringw m_name;
|
||||
core::stringw m_local_name;
|
||||
|
||||
/** True if this account is a guest account. */
|
||||
bool m_is_guest_account;
|
||||
@ -103,7 +103,7 @@ public:
|
||||
#ifdef DEBUG
|
||||
assert(m_magic_number == 0xABCD1234);
|
||||
#endif
|
||||
m_name = name;
|
||||
m_local_name = name;
|
||||
} // setName
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -111,7 +111,7 @@ public:
|
||||
core::stringw getName() const
|
||||
{
|
||||
assert(m_magic_number == 0xABCD1234);
|
||||
return m_name.c_str();
|
||||
return m_local_name.c_str();
|
||||
} // getName
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -178,7 +178,6 @@
|
||||
#include "network/server_network_manager.hpp"
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "network/protocols/server_lobby_room_protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/profile_manager.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "online/servers_manager.hpp"
|
||||
@ -966,7 +965,7 @@ int handleCmdLine()
|
||||
{
|
||||
irr::core::stringw s;
|
||||
Online::XMLRequest* request =
|
||||
PlayerManager::getCurrentUser()->requestSignIn(login, password, false, false);
|
||||
PlayerManager::requestSignIn(login, password, false, false);
|
||||
request->executeNow();
|
||||
|
||||
if (request->isSuccess())
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "network/network_manager.hpp"
|
||||
#include "network/network_world.hpp"
|
||||
#include "network/protocols/start_game_protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/online_profile.hpp"
|
||||
#include "states_screens/network_kart_selection.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "network/protocols/hide_public_address.hpp"
|
||||
#include "network/protocols/request_connection.hpp"
|
||||
#include "network/protocols/ping_protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/time.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "network/protocols/ping_protocol.hpp"
|
||||
#include "network/protocols/quick_join_protocol.hpp"
|
||||
#include "network/protocols/client_lobby_room_protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/time.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
|
@ -19,11 +19,10 @@
|
||||
#include "network/protocols/get_peer_address.hpp"
|
||||
|
||||
#include "config/player_manager.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
GetPeerAddress::GetPeerAddress(uint32_t peer_id, CallbackObject* callback_object) : Protocol(callback_object, PROTOCOL_SILENT)
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
HidePublicAddress::HidePublicAddress() : Protocol(NULL, PROTOCOL_SILENT)
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "config/player_manager.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "online/servers_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
using namespace Online;
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define HEADER_REQUEST_CONNECTION_HPP
|
||||
|
||||
#include "network/protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/xml_request.hpp"
|
||||
|
||||
class RequestConnection : public Protocol
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "network/protocols/start_server.hpp"
|
||||
#include "network/protocols/start_game_protocol.hpp"
|
||||
#include "network/server_network_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/online_profile.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
ShowPublicAddress::ShowPublicAddress() : Protocol(NULL, PROTOCOL_SILENT)
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "network/game_setup.hpp"
|
||||
#include "network/network_world.hpp"
|
||||
#include "network/protocols/synchronization_protocol.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/online_profile.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
@ -19,8 +18,8 @@
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/time.hpp"
|
||||
|
||||
StartGameProtocol::StartGameProtocol(GameSetup* game_setup) :
|
||||
Protocol(NULL, PROTOCOL_START_GAME)
|
||||
StartGameProtocol::StartGameProtocol(GameSetup* game_setup)
|
||||
: Protocol(NULL, PROTOCOL_START_GAME)
|
||||
{
|
||||
m_game_setup = game_setup;
|
||||
std::vector<NetworkPlayerProfile*> players = m_game_setup->getPlayers();
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "config/player_manager.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
|
||||
StartServer::StartServer() : Protocol(NULL, PROTOCOL_SILENT)
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "config/player_manager.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/request_manager.hpp"
|
||||
|
||||
StopServer::StopServer() : Protocol(NULL, PROTOCOL_SILENT)
|
||||
|
@ -388,18 +388,6 @@ namespace Online
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** \return the username if signed in. */
|
||||
core::stringw CurrentUser::getUserName() const
|
||||
{
|
||||
if((m_state == US_SIGNED_IN ) || (m_state == US_GUEST))
|
||||
{
|
||||
assert(m_profile != NULL);
|
||||
return m_profile->getUserName();
|
||||
}
|
||||
return _("Currently not signed in");
|
||||
} // getUserName
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** \return the online id, or 0 if the user is not signed in.
|
||||
*/
|
||||
|
@ -119,26 +119,23 @@ namespace Online
|
||||
/** Returns a pointer to the profile associated with the current
|
||||
* user. */
|
||||
OnlineProfile* getProfile() const { return m_profile; }
|
||||
|
||||
|
||||
public:
|
||||
CurrentUser();
|
||||
void requestSavedSession();
|
||||
SignInRequest * requestSignIn( const irr::core::stringw &username,
|
||||
const irr::core::stringw &password,
|
||||
bool save_session,
|
||||
bool request_now = true);
|
||||
void requestSignOut();
|
||||
|
||||
void requestFriendRequest(const uint32_t friend_id) const;
|
||||
void onSTKQuit() const;
|
||||
void requestPoll() const;
|
||||
|
||||
irr::core::stringw getUserName() const;
|
||||
// ----------------------------------------------------------------
|
||||
// ----------------------------------------------------------------
|
||||
/** Returns the session token of the signed in user. */
|
||||
const std::string& getToken() const { return m_token; }
|
||||
void requestPoll() const;
|
||||
void requestSavedSession();
|
||||
void onSTKQuit() const;
|
||||
void requestSignOut();
|
||||
SignInRequest *requestSignIn(const irr::core::stringw &username,
|
||||
const irr::core::stringw &password,
|
||||
bool save_session,
|
||||
bool request_now = true);
|
||||
|
||||
public:
|
||||
CurrentUser();
|
||||
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
}; // class CurrentUser
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "online/profile_manager.hpp"
|
||||
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/online_profile.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "online/request_manager.hpp"
|
||||
|
||||
#include "config/player_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
||||
#include <iostream>
|
||||
@ -132,7 +131,7 @@ namespace Online
|
||||
// In case that login id was not saved (or first start of stk),
|
||||
// current player would not be defined at this stage.
|
||||
if(PlayerManager::getCurrentPlayer())
|
||||
PlayerManager::getCurrentUser()->requestSavedSession();
|
||||
PlayerManager::resumeSavedSession();
|
||||
} // startNetworkThread
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -150,7 +149,7 @@ namespace Online
|
||||
// a download, which mean we can get the mutex and ask the service
|
||||
// thread here to cancel properly.
|
||||
//cancelAllDownloads(); FIXME if used this way it also cancels the client-quit action
|
||||
PlayerManager::getCurrentUser()->onSTKQuit();
|
||||
PlayerManager::onSTKQuit();
|
||||
addRequest(new Request(true, HTTP_MAX_PRIORITY, Request::RT_QUIT));
|
||||
} // stopNetworkThread
|
||||
|
||||
@ -295,7 +294,7 @@ namespace Online
|
||||
if(m_time_since_poll > interval)
|
||||
{
|
||||
m_time_since_poll = 0;
|
||||
PlayerManager::getCurrentUser()->requestPoll();
|
||||
PlayerManager::requestOnlinePoll();
|
||||
}
|
||||
|
||||
} // update
|
||||
|
@ -58,7 +58,7 @@ void CreateServerScreen::loadedFromFile()
|
||||
|
||||
m_name_widget = getWidget<TextBoxWidget>("name");
|
||||
assert(m_name_widget != NULL);
|
||||
m_name_widget->setText(PlayerManager::getCurrentUser()->getUserName() + _("'s server"));
|
||||
m_name_widget->setText(PlayerManager::getCurrentOnlineUserName() + _("'s server"));
|
||||
m_max_players_widget = getWidget<SpinnerWidget>("max_players");
|
||||
assert(m_max_players_widget != NULL);
|
||||
m_max_players_widget->setValue(8);
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "guiengine/screen.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/xml_request.hpp"
|
||||
|
||||
|
||||
|
@ -20,10 +20,11 @@
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "online/messages.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
#include <irrString.h>
|
||||
|
@ -19,13 +19,16 @@
|
||||
#ifndef HEADER_CHANGE_PASSWORD_DIALOG_HPP
|
||||
#define HEADER_CHANGE_PASSWORD_DIALOG_HPP
|
||||
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
class IconButtonWidget;
|
||||
class LabelWidget;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to sign in
|
||||
* \ingroup states_screens
|
||||
|
@ -35,7 +35,7 @@ using namespace Online;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
NotificationDialog::NotificationDialog(Type type, const core::stringw info)
|
||||
NotificationDialog::NotificationDialog(Type type, const core::stringw &info)
|
||||
: ModalDialog(0.8f,0.5f)
|
||||
{
|
||||
m_info = info;
|
||||
|
@ -19,13 +19,12 @@
|
||||
#ifndef HEADER_NOTIFICATION_DIALOG_HPP
|
||||
#define HEADER_NOTIFICATION_DIALOG_HPP
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/types.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to sign in
|
||||
@ -53,7 +52,7 @@ private:
|
||||
GUIEngine::IconButtonWidget * m_cancel_widget;
|
||||
|
||||
public:
|
||||
NotificationDialog(Type type, const core::stringw info);
|
||||
NotificationDialog(Type type, const core::stringw &info);
|
||||
~NotificationDialog();
|
||||
|
||||
virtual void beforeAddingWidgets();
|
||||
|
@ -20,10 +20,10 @@
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "online/messages.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
|
@ -19,11 +19,14 @@
|
||||
#ifndef HEADER_RECOVERY_DIALOG_HPP
|
||||
#define HEADER_RECOVERY_DIALOG_HPP
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
namespace Online
|
||||
{
|
||||
class XMLRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to recover his account
|
||||
|
@ -17,16 +17,16 @@
|
||||
|
||||
#include "states_screens/dialogs/registration_dialog.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "states_screens/register_screen.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "online/messages.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
using namespace GUIEngine;
|
||||
using namespace irr;
|
||||
|
@ -19,11 +19,8 @@
|
||||
#ifndef HEADER_REGISTRATION_DIALOG_HPP
|
||||
#define HEADER_REGISTRATION_DIALOG_HPP
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to register
|
||||
* \ingroup states_screens
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "network/protocols/connect_to_server.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "online/servers_manager.hpp"
|
||||
#include "states_screens/dialogs/registration_dialog.hpp"
|
||||
|
@ -19,17 +19,15 @@
|
||||
#ifndef HEADER_SERVER_INFO_DIALOG_HPP
|
||||
#define HEADER_SERVER_INFO_DIALOG_HPP
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets/icon_button_widget.hpp"
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "network/protocols/request_connection.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/server.hpp"
|
||||
#include "utils/types.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to sign in
|
||||
|
@ -21,12 +21,15 @@
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/profile_manager.hpp"
|
||||
#include "utils/types.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
namespace Online
|
||||
{
|
||||
class OnlineProfile;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Dialog that allows a user to sign in
|
||||
* \ingroup states_screens
|
||||
|
@ -18,18 +18,16 @@
|
||||
#include "states_screens/dialogs/vote_dialog.hpp"
|
||||
|
||||
#include "addons/addons_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/messages.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
|
||||
|
||||
using namespace GUIEngine;
|
||||
using namespace irr;
|
||||
using namespace irr::gui;
|
||||
|
@ -19,12 +19,16 @@
|
||||
#ifndef HEADER_VOTE_DIALOG_HPP
|
||||
#define HEADER_VOTE_DIALOG_HPP
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
namespace Online
|
||||
{
|
||||
class XMLRequest;
|
||||
}
|
||||
/**
|
||||
* \brief Dialog that allows a user to sign in
|
||||
* \ingroup states_screens
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "guiengine/widgets/text_box_widget.hpp"
|
||||
#include "guiengine/widgets/check_box_widget.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "states_screens/guest_login_screen.hpp"
|
||||
#include "states_screens/online_screen.hpp"
|
||||
@ -99,8 +98,7 @@ void LoginScreen::login()
|
||||
m_options_widget->setDeactivated();
|
||||
info_widget->setDefaultColor();
|
||||
bool remember = getWidget<CheckBoxWidget>("remember")->getState();
|
||||
PlayerManager::getCurrentUser()->requestSignIn(username, password,
|
||||
remember );
|
||||
PlayerManager::requestSignIn(username, password, remember);
|
||||
}
|
||||
} // login
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "network/protocol_manager.hpp"
|
||||
#include "network/protocols/client_lobby_room_protocol.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
||||
static const char RANDOM_KART_ID[] = "randomkart";
|
||||
|
@ -138,7 +138,7 @@ void OnlineScreen::init()
|
||||
setInitialFocus();
|
||||
DemoWorld::resetIdleTime();
|
||||
core::stringw m = _("Signed in as: %s.",
|
||||
PlayerManager::getCurrentUser()->getUserName());
|
||||
PlayerManager::getCurrentOnlineUserName());
|
||||
m_online_status_widget->setText(m, false);
|
||||
} // init
|
||||
|
||||
@ -226,7 +226,7 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name,
|
||||
|
||||
if (selection == m_sign_out_widget->m_properties[PROP_ID])
|
||||
{
|
||||
PlayerManager::getCurrentUser()->requestSignOut();
|
||||
PlayerManager::requestSignOut();
|
||||
StateManager::get()->popMenu();
|
||||
}
|
||||
else if (selection == m_profile_widget->m_properties[PROP_ID])
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "online/profile_manager.hpp"
|
||||
#include "states_screens/dialogs/user_info_dialog.hpp"
|
||||
#include "states_screens/dialogs/message_dialog.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "guiengine/widgets/text_box_widget.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "online/xml_request.hpp"
|
||||
#include "states_screens/dialogs/registration_dialog.hpp"
|
||||
#include "states_screens/dialogs/message_dialog.hpp"
|
||||
#include "states_screens/guest_login_screen.hpp"
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "guiengine/widgets/check_box_widget.hpp"
|
||||
#include "guiengine/widgets/list_widget.hpp"
|
||||
#include "online/current_user.hpp"
|
||||
#include "states_screens/dialogs/enter_player_name_dialog.hpp"
|
||||
#include "states_screens/main_menu_screen.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
@ -124,7 +123,7 @@ void StoryModeLobbyScreen::eventCallback(Widget* widget,
|
||||
// a login (if an online login was saved). If the current player was
|
||||
// saved, this request will be started much earlier in the startup
|
||||
// sequence from the RequestManager.
|
||||
player->getCurrentUser()->requestSavedSession();
|
||||
PlayerManager::resumeSavedSession();
|
||||
}
|
||||
} // eventCallback
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user