mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Ref T659, login mode as string
This commit is contained in:
committed by
Mat Sutcliffe
parent
23a44ced2a
commit
daf927223a
@@ -254,6 +254,9 @@ namespace BlackCore
|
||||
//! Login mode
|
||||
virtual INetwork::LoginMode getLoginMode() const = 0;
|
||||
|
||||
//! Mode as string
|
||||
const QString &getLoginModeAsString() const { return INetwork::modeAsString(this->getLoginMode()); }
|
||||
|
||||
//! Disconnect from network
|
||||
//! \return messages generated during disconnecting
|
||||
virtual BlackMisc::CStatusMessage disconnectFromNetwork() = 0;
|
||||
|
||||
@@ -39,6 +39,23 @@ namespace BlackCore
|
||||
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)
|
||||
{
|
||||
if (identifier.isEmpty() || !m_statistics) { return -1; }
|
||||
|
||||
@@ -93,6 +93,9 @@ namespace BlackCore
|
||||
LoginStealth //!< Login stealth mode
|
||||
};
|
||||
|
||||
//! Mode as string
|
||||
static const QString &modeAsString(LoginMode mode);
|
||||
|
||||
//! Status of the connection.
|
||||
enum ConnectionStatus
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user