mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T659, login mode as string
This commit is contained in:
committed by
Mat Sutcliffe
parent
cd25ca8bd3
commit
83c6a5d4eb
@@ -254,6 +254,9 @@ namespace BlackCore
|
|||||||
//! Login mode
|
//! Login mode
|
||||||
virtual INetwork::LoginMode getLoginMode() const = 0;
|
virtual INetwork::LoginMode getLoginMode() const = 0;
|
||||||
|
|
||||||
|
//! Mode as string
|
||||||
|
const QString &getLoginModeAsString() const { return INetwork::modeAsString(this->getLoginMode()); }
|
||||||
|
|
||||||
//! Disconnect from network
|
//! Disconnect from network
|
||||||
//! \return messages generated during disconnecting
|
//! \return messages generated during disconnecting
|
||||||
virtual BlackMisc::CStatusMessage disconnectFromNetwork() = 0;
|
virtual BlackMisc::CStatusMessage disconnectFromNetwork() = 0;
|
||||||
|
|||||||
@@ -39,6 +39,23 @@ namespace BlackCore
|
|||||||
INetwork::~INetwork()
|
INetwork::~INetwork()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
const QString &INetwork::modeAsString(INetwork::LoginMode mode)
|
||||||
|
{
|
||||||
|
static const QString n("normal");
|
||||||
|
static const QString o("observer");
|
||||||
|
static const QString s("stealth");
|
||||||
|
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case LoginNormal: return n;
|
||||||
|
case LoginAsObserver: return o;
|
||||||
|
case LoginStealth: return s;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
static const QString unknown("????");
|
||||||
|
return unknown;
|
||||||
|
}
|
||||||
|
|
||||||
int INetwork::increaseStatisticsValue(const QString &identifier, const QString &appendix)
|
int INetwork::increaseStatisticsValue(const QString &identifier, const QString &appendix)
|
||||||
{
|
{
|
||||||
if (identifier.isEmpty() || !m_statistics) { return -1; }
|
if (identifier.isEmpty() || !m_statistics) { return -1; }
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ namespace BlackCore
|
|||||||
LoginStealth //!< Login stealth mode
|
LoginStealth //!< Login stealth mode
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Mode as string
|
||||||
|
static const QString &modeAsString(LoginMode mode);
|
||||||
|
|
||||||
//! Status of the connection.
|
//! Status of the connection.
|
||||||
enum ConnectionStatus
|
enum ConnectionStatus
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user