Initial Commit

This commit is contained in:
2016-07-27 00:32:34 -04:00
commit 8d162b2035
701 changed files with 188672 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pluto.Registration;
using Pluto.MSL.Api;
namespace AutoUpdater
{
class Program
{
const int SLEEP_INTERVAL_AFTER_EACH_UPDATE_CALL_TO_NOT_OVERLOAD_SERVER_IN_MS = 2000;
const int NUMBER_OF_TIMES_TO_RUN_THRU_UPDATE_LOOP_TO_MAKE_SURE_WE_UPDATED_ALL = 3;
static void Main(string[] args)
{
Client[] clients = RegistrationWrapper.GetClients();
if (clients != null)
{
for (int i = 0; i < NUMBER_OF_TIMES_TO_RUN_THRU_UPDATE_LOOP_TO_MAKE_SURE_WE_UPDATED_ALL; ++i)
{
foreach (Client client in clients)
{
bool bCanConnect = Yaulw.Net.IPHostHelper.HasConnectivity(client.host.host, (uint)client.host.port, 0);
if (bCanConnect)
{
API.SetNetworkSettings(client.host.host, (uint)client.host.port);
API.UpdateServiceIfNeeded();
System.Threading.Thread.Sleep(SLEEP_INTERVAL_AFTER_EACH_UPDATE_CALL_TO_NOT_OVERLOAD_SERVER_IN_MS);
}
}
}
}
}
}
}