MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / Engine

Method Engine

src/client/engine/engine/engine.cpp:64–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62using namespace wsnet;
63
64Engine::Engine() : QObject(nullptr),
65 helper_(nullptr),
66 firewallController_(nullptr),
67 connectionManager_(nullptr),
68 connectStateController_(nullptr),
69 vpnShareController_(nullptr),
70 emergencyController_(nullptr),
71 customConfigs_(nullptr),
72 customOvpnAuthCredentialsStorage_(nullptr),
73 networkDetectionManager_(nullptr),
74 macAddressController_(nullptr),
75 keepAliveManager_(nullptr),
76 packetSizeController_(nullptr),
77 myIpManager_(nullptr),
78#ifdef Q_OS_WIN
79 measurementCpuUsage_(nullptr),
80#endif
81 inititalizeHelper_(nullptr),
82 bInitialized_(false),
83 locationsModel_(nullptr),
84 downloadHelper_(nullptr),
85#ifdef Q_OS_MACOS
86 autoUpdaterHelper_(nullptr),
87 macSpoofTimer_(nullptr),
88#endif
89 isBlockConnect_(false),
90 isCleanupFinished_(false),
91 isNeedReconnectAfterRequestAuth_(false),
92 online_(false),
93 packetSizeControllerThread_(nullptr),
94 runningPacketDetection_(false),
95 lastDownloadProgress_(0),
96 installerUrl_(""),
97 guiWindowHandle_(0),
98 overrideUpdateChannelWithInternal_(false),
99 bPrevNetworkInterfaceInitialized_(false),
100 connectionSettingsOverride_(types::Protocol(types::Protocol::TYPE::UNINITIALIZED), 0, true),
101 loginWaitForNetworkConnectivity_(nullptr)
102{
103
104 if (!engineSettings_.loadFromSettings()) {
105 qCInfo(LOG_BASIC) << "Use default engine settings since the previous ones were not loaded";
106 }
107 qCInfo(LOG_BASIC) << "Engine settings" << engineSettings_;
108
109 auto wsnetLoggerCallback = [](const std::string &logStr) {
110 // log wsnet outputs without formatting
111 auto logger = spdlog::get("raw");
112 if (logger) {
113 logger->info(logStr);
114 }
115 };
116
117 // Design Note:
118 // Hardcoding the AmneziaWG protocol version since we cannot retrieve it from the AmneziaWG binary.
119 QSettings settings;
120 std::string wsnetSettings = settings.value("wsnetSettings").toString().toStdString();
121 bool bWsnetSuccess = WSNet::initialize(Utils::getBasePlatformName().toStdString(), Utils::getPlatformNameSafe().toStdString(),

Callers

nothing calls this directly

Calls 12

ProtocolClass · 0.85
toStringMethod · 0.80
semanticVersionStringMethod · 0.80
getDeviceIdMethod · 0.80
getOpenVpnVersionMethod · 0.80
isStagingMethod · 0.80
loadFromSettingsMethod · 0.45
languageMethod · 0.45
setCallbackMethod · 0.45
isAPIAntiCensorshipMethod · 0.45
setDnsManagerMethod · 0.45
dnsManagerMethod · 0.45

Tested by

no test coverage detected