[Node] Fallback client implementation
This commit is contained in:
parent
6f85105902
commit
d4e78a09a5
@ -173,6 +173,8 @@ namespace Components
|
|||||||
|
|
||||||
if (!Loader::PerformingUnitTests())
|
if (!Loader::PerformingUnitTests())
|
||||||
{
|
{
|
||||||
|
Node::LoadNodeRemotePreset();
|
||||||
|
|
||||||
while (!News::Terminate)
|
while (!News::Terminate)
|
||||||
{
|
{
|
||||||
News::CheckForUpdate();
|
News::CheckForUpdate();
|
||||||
|
@ -8,6 +8,20 @@ namespace Components
|
|||||||
std::vector<Node::NodeEntry> Node::Nodes;
|
std::vector<Node::NodeEntry> Node::Nodes;
|
||||||
std::vector<Node::ClientSession> Node::Sessions;
|
std::vector<Node::ClientSession> Node::Sessions;
|
||||||
|
|
||||||
|
void Node::LoadNodeRemotePreset()
|
||||||
|
{
|
||||||
|
std::string nodes = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/nodex.txt").SetTimeout(5000)->Get();
|
||||||
|
if (nodes.empty()) return;
|
||||||
|
|
||||||
|
auto nodeList = Utils::String::Explode(nodes, '\n');
|
||||||
|
for (auto node : nodeList)
|
||||||
|
{
|
||||||
|
Utils::String::Replace(node, "\r", "");
|
||||||
|
node = Utils::String::Trim(node);
|
||||||
|
Node::AddNode(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Node::LoadNodePreset()
|
void Node::LoadNodePreset()
|
||||||
{
|
{
|
||||||
Proto::Node::List list;
|
Proto::Node::List list;
|
||||||
|
@ -28,6 +28,8 @@ namespace Components
|
|||||||
|
|
||||||
static unsigned int GetValidNodeCount();
|
static unsigned int GetValidNodeCount();
|
||||||
|
|
||||||
|
static void LoadNodeRemotePreset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EntryState
|
enum EntryState
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user