2017-12-25 23:49:48 +00:00
|
|
|
#ifndef LOGIN_HPP_INCLUDED
|
|
|
|
#define LOGIN_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "../../Core/Types/Box.hpp"
|
|
|
|
#include "../../Core/Classes/World.hpp"
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2018-12-27 18:17:09 +00:00
|
|
|
namespace Login
|
2017-12-25 23:49:48 +00:00
|
|
|
{
|
2018-12-27 18:17:09 +00:00
|
|
|
typedef enum LOGIN_SCREEN_STATE
|
|
|
|
{
|
2019-07-19 21:40:09 +00:00
|
|
|
WELCOME_SCREEN,
|
|
|
|
PVP_WORLD,
|
|
|
|
ENTER_CREDENTIALS,
|
|
|
|
INVALID_CREDENTIALS,
|
|
|
|
AUTHENTICATOR,
|
|
|
|
FORGOTTEN_PASSWORD,
|
2018-12-27 18:17:09 +00:00
|
|
|
RUNESCAPE_UPDATED,
|
|
|
|
ACCOUNT_LOCKED,
|
|
|
|
MEMBERS_AREA,
|
|
|
|
MEMBERS_REQUIRED,
|
|
|
|
WORLD_SELECT,
|
|
|
|
ACCOUNT_DISABLED,
|
2019-07-19 21:40:09 +00:00
|
|
|
ACCOUNT_LOGGED_IN,
|
|
|
|
TOTAL_SKILL_REQUIRED,
|
|
|
|
DISCONNECTED,
|
2020-03-01 13:12:49 +00:00
|
|
|
ERROR_CONNECTING,
|
2020-06-25 18:13:21 +00:00
|
|
|
CONNECTION_TIMED_OUT,
|
|
|
|
TOO_MANY_ATTEMPTS,
|
2018-12-27 18:17:09 +00:00
|
|
|
CONNECTING,
|
|
|
|
LOADING,
|
|
|
|
LOBBY_SCREEN,
|
|
|
|
LOGGED_IN
|
|
|
|
} LOGIN_SCREEN_STATE;
|
|
|
|
|
|
|
|
LOGIN_SCREEN_STATE GetLoginScreenState();
|
|
|
|
|
2019-07-19 21:40:09 +00:00
|
|
|
bool LoginPlayer(bool SwitchToProfileWorld = true);
|
2018-12-27 18:17:09 +00:00
|
|
|
bool EnterCredentials();
|
|
|
|
|
|
|
|
bool IsWorldSelectOpen();
|
|
|
|
bool OpenWorldSelect();
|
|
|
|
bool CloseWorldSelect();
|
|
|
|
|
|
|
|
bool SelectWorld();
|
2019-01-29 20:07:44 +00:00
|
|
|
bool SelectWorld(const Internal::World& World);
|
2018-12-27 18:17:09 +00:00
|
|
|
bool SelectWorld(std::int32_t WorldID);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return X of where the login screen starts
|
|
|
|
*/
|
|
|
|
std::int32_t GetScreenX();
|
|
|
|
/**
|
|
|
|
* @return X of where the login window starts
|
|
|
|
*/
|
|
|
|
std::int32_t GetWindowX();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return current state of the login caret
|
|
|
|
* 0: Username line; 1: Password line;
|
|
|
|
*/
|
|
|
|
std::int32_t GetCaretState();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return a vector of login messages
|
|
|
|
* 0: LoginMessage0; 1: LoginMessage1; 2: LoginMessage2;
|
|
|
|
*/
|
|
|
|
std::vector<std::string> GetLoginMessages();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return a vector of button boxes on the login screen
|
|
|
|
* 0: Existing User; 1: Login; 2: Cancel; 3: Try Again; 4: World Select; 5: World Select Cancel;
|
|
|
|
*/
|
|
|
|
std::vector<Box> GetButtonBoxes();
|
|
|
|
|
2019-07-19 21:40:09 +00:00
|
|
|
bool WaitLoginScreenState(std::uint32_t Duration, std::uint32_t Step, Login::LOGIN_SCREEN_STATE State, bool Result = true);
|
|
|
|
|
2018-12-31 21:52:58 +00:00
|
|
|
}
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
#endif // LOGIN_HPP_INCLUDED
|