示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (StartupStatus != 0)
            {
                hash ^= StartupStatus.GetHashCode();
            }
            if (PlayerStatus != 0)
            {
                hash ^= PlayerStatus.GetHashCode();
            }
            if (Message.Length != 0)
            {
                hash ^= Message.GetHashCode();
            }
            if (playerProfile_ != null)
            {
                hash ^= PlayerProfile.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
        public void HandleRequest(HttpListenerContext context)
        {
            var req  = context.Request;
            var resp = context.Response;

            try
            {
                var ss = new StartupStatus();
                ss.UpgradeRestoreAvailable = false;
                if (_mod.IsBeatSaberInstalled && _mod.IsInstalledBeatSaberModded)
                {
                    var qaeConfig = _getQaeConfig();
                    if (qaeConfig.RootFileProvider.FileExists(Constants.LAST_COMMITTED_CONFIG))
                    {
                        var si    = _getSyncInfo();
                        var bsVer = _mod.GetBeatSaberVersion();
                        if (si?.LastSyncedBeatSaberVersion != bsVer)
                        {
                            var qae = _getQae();
                            if (!qae.OpManager.IsProcessing)
                            {
                                ss.UpgradeRestoreAvailable = true;
                            }
                        }
                    }
                }
                resp.SerializeOk(ss);
            }
            catch (Exception ex)
            {
                Log.LogErr("Exception handling mod status!", ex);
                resp.StatusCode = 500;
            }
        }
示例#3
0
        public async Task Startup()
        {
            NetworkStartupStatus = StartupStatus.NodeConnection;
            while (!networkFeatures.IsNodeStatusOnline())
            {
                Thread.Sleep(5000);
            }

            NetworkStartupStatus = StartupStatus.Database;
            while (!networkFeatures.IsDatabaseConnected())
            {
                Thread.Sleep(5000);
            }

            NetworkStartupStatus = StartupStatus.IBD;
            var blockchainInfo = await networkFeatures.GetBlockchainInfo();

            while (blockchainInfo.initialblockdownload)
            {
                Thread.Sleep(5000);
                blockchainInfo = await networkFeatures.GetBlockchainInfo();
            }

            NetworkStartupStatus = StartupStatus.AddressIndexer;
            blockchainInfo       = await networkFeatures.GetBlockchainInfo();

            var addressIndexerTip = await networkFeatures.GetAddressIndexerTip();

            while (blockchainInfo.blocks != addressIndexerTip.tipHeight)
            {
                Thread.Sleep(5000);
                addressIndexerTip = await networkFeatures.GetAddressIndexerTip();

                blockchainInfo = await networkFeatures.GetBlockchainInfo();
            }

            if (!networkSettings.BypassTierCheck)
            {
                NetworkStartupStatus = StartupStatus.XServerConnection;
                int tier2Count = 0;
                int tier3Count = 0;
                while (tier2Count == 0 || tier3Count == 0)
                {
                    var xServers = await networkFeatures.GetXServerStats();

                    tier2Count = xServers.Nodes.Where(n => n.Tier == (int)TierLevel.Two).Count();
                    tier3Count = xServers.Nodes.Where(n => n.Tier == (int)TierLevel.Three).Count();
                    Thread.Sleep(5000);
                }
            }

            NetworkStartupStatus = StartupStatus.Profile;
            await networkFeatures.SyncProfiles(this.networkCancellationTokenSource.Token);

            NetworkStartupStatus = StartupStatus.XServer;
            await ReconcilexServersAsync(this.networkCancellationTokenSource.Token);

            NetworkStartupStatus = StartupStatus.Started;
        }
示例#4
0
        public NetworkMonitor(
            ILogger mainLogger,
            IxServerLifetime serverLifetime,
            IAsyncLoopFactory asyncLoopFactory,
            DatabaseSettings databaseSettings,
            NetworkFeatures networkFeatures,
            ServerNodeBase network,
            NetworkSettings networkSettings
            )
        {
            logger = mainLogger;
            this.serverLifetime   = serverLifetime;
            this.asyncLoopFactory = asyncLoopFactory;
            this.databaseSettings = databaseSettings;
            this.networkFeatures  = networkFeatures;
            this.network          = network;
            this.networkSettings  = networkSettings;

            NetworkStartupStatus = StartupStatus.NotStarted;
        }
示例#5
0
 public frmStartupScreen()
 {
     InitializeComponent();
     this.Status = StartupStatus.None;
 }