mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-07 10:05:51 +08:00
refactor: Remove unused server types and ecosystems
This commit is contained in:
@@ -45,8 +45,7 @@ namespace swift::core::data
|
||||
{
|
||||
const CServer server(this->getLastServer());
|
||||
if (server.isNull()) { return false; }
|
||||
return server.getEcosystem() == CEcosystem::privateFsd() || server.getEcosystem() == CEcosystem::swiftTest() ||
|
||||
server.getEcosystem() == CEcosystem::swift();
|
||||
return server.getEcosystem() == CEcosystem::privateFsd();
|
||||
}
|
||||
|
||||
void CNetworkSetup::onSettingsChanged() { emit this->setupChanged(); }
|
||||
|
||||
@@ -29,18 +29,6 @@ namespace swift::misc::network
|
||||
return e;
|
||||
}
|
||||
|
||||
const CEcosystem &CEcosystem::swift()
|
||||
{
|
||||
static const CEcosystem e(Swift);
|
||||
return e;
|
||||
}
|
||||
|
||||
const CEcosystem &CEcosystem::swiftTest()
|
||||
{
|
||||
static const CEcosystem e(SwiftTest);
|
||||
return e;
|
||||
}
|
||||
|
||||
const CEcosystem &CEcosystem::privateFsd()
|
||||
{
|
||||
static const CEcosystem e(PrivateFSD);
|
||||
@@ -51,16 +39,12 @@ namespace swift::misc::network
|
||||
{
|
||||
static const QString u("unknown");
|
||||
static const QString v("VATSIM");
|
||||
static const QString s("swift");
|
||||
static const QString st("swift (testing)");
|
||||
static const QString fsd("FSD (private)");
|
||||
static const QString no("no system");
|
||||
|
||||
switch (this->getSystem())
|
||||
{
|
||||
case VATSIM: return v;
|
||||
case Swift: return s;
|
||||
case SwiftTest: return st;
|
||||
case PrivateFSD: return fsd;
|
||||
case NoSystem: return no;
|
||||
case Unspecified:
|
||||
|
||||
@@ -33,8 +33,6 @@ namespace swift::misc::network
|
||||
Unspecified, //!< unspecified
|
||||
NoSystem, //!< no relevant ecosystem
|
||||
VATSIM, //!< VATSIM
|
||||
SwiftTest, //!< swift test server
|
||||
Swift, //!< Future usage
|
||||
PrivateFSD //!< Private FSD environment
|
||||
};
|
||||
|
||||
@@ -77,12 +75,6 @@ namespace swift::misc::network
|
||||
//! VATSIM eco system
|
||||
static const CEcosystem &vatsim();
|
||||
|
||||
//! swift eco system
|
||||
static const CEcosystem &swift();
|
||||
|
||||
//! swift test eco system
|
||||
static const CEcosystem &swiftTest();
|
||||
|
||||
//! FSD private
|
||||
static const CEcosystem &privateFsd();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace swift::misc::network
|
||||
const CEcosystemList &CEcosystemList::allKnownSystems()
|
||||
{
|
||||
static const CEcosystemList s(
|
||||
{ CEcosystem::vatsim(), CEcosystem::swift(), CEcosystem::swiftTest(), CEcosystem::privateFsd() });
|
||||
{ CEcosystem::vatsim(), CEcosystem::privateFsd() });
|
||||
return s;
|
||||
}
|
||||
} // namespace swift::misc::network
|
||||
|
||||
@@ -74,10 +74,6 @@ namespace swift::misc::network
|
||||
{
|
||||
if (!this->hasProvider()) { return false; }
|
||||
if (this->isCurrentEcosystemVATSIM()) { return false; }
|
||||
if (this->isCurrentEcosystem(CEcosystem::swiftTest()))
|
||||
{
|
||||
return false;
|
||||
} // our test server is supposed to be I VATSIM system
|
||||
return !this->getCurrentEcosystem().isUnspecified(); // other know system which is specified
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace swift::misc::network
|
||||
const QList<int> &CServer::allServerTypes()
|
||||
{
|
||||
static const QList<int> all(
|
||||
{ FSDServerVatsim, VoiceServerVatsim, FSDServer, VoiceServer, WebService, Unspecified });
|
||||
{ FSDServerVatsim, FSDServer, Unspecified });
|
||||
return all;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace swift::misc::network
|
||||
{
|
||||
static const CServer s =
|
||||
CServer("ES Tower", "Euroscope Tower view", "localhost", 6809, CUser(), CFsdSetup::vatsimStandard(),
|
||||
CEcosystem(CEcosystem::vatsim()), CServer::VoiceServerVatsim);
|
||||
CEcosystem(CEcosystem::vatsim()), CServer::FSDServer);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ namespace swift::misc::network
|
||||
|
||||
// cross dependency
|
||||
if (ecosystem.isSystem(CEcosystem::VATSIM)) { m_serverType = FSDServerVatsim; }
|
||||
if (ecosystem.isSystem(CEcosystem::SwiftTest)) { m_serverType = FSDServerVatsim; }
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -247,19 +246,13 @@ namespace swift::misc::network
|
||||
const QString &CServer::serverTypeToString(CServer::ServerType server)
|
||||
{
|
||||
static const QString fsdVatsim("FSD [VATSIM]");
|
||||
static const QString voiceVatsim("voice [VATSIM]");
|
||||
static const QString fsdLegacy("FSD (legacy)");
|
||||
static const QString voice("voice");
|
||||
static const QString webService("web service");
|
||||
static const QString unspecified("unspecified");
|
||||
|
||||
switch (server)
|
||||
{
|
||||
case FSDServerVatsim: return fsdVatsim;
|
||||
case VoiceServerVatsim: return voiceVatsim;
|
||||
case FSDServer: return fsdLegacy;
|
||||
case VoiceServer: return voice;
|
||||
case WebService: return webService;
|
||||
case Unspecified:
|
||||
default: return unspecified;
|
||||
}
|
||||
|
||||
@@ -48,9 +48,6 @@ namespace swift::misc::network
|
||||
Unspecified,
|
||||
FSDServerVatsim,
|
||||
FSDServer,
|
||||
VoiceServerVatsim,
|
||||
VoiceServer,
|
||||
WebService,
|
||||
};
|
||||
|
||||
//! Allows to iterate over all ServerType
|
||||
|
||||
Reference in New Issue
Block a user