private async Task <ServerStatusUpdate> GenerateServerStatusUpdateAsync(ServerStatusUpdateRegistration registration)
        {
            var registrationKey = registration.SteamEndpoint.ToString();

            //
            // First check the process status
            //
            var processStatus = GetServerProcessStatus(registration, out Process process);

            switch (processStatus)
            {
            case ServerProcessStatus.NotInstalled:
                return(new ServerStatusUpdate {
                    Status = WatcherServerStatus.NotInstalled
                });

            case ServerProcessStatus.Stopped:
                return(new ServerStatusUpdate {
                    Status = WatcherServerStatus.Stopped
                });

            case ServerProcessStatus.Unknown:
                return(new ServerStatusUpdate {
                    Status = WatcherServerStatus.Unknown
                });

            case ServerProcessStatus.Running:
                break;

            default:
                Debugger.Break();
                break;
            }

            var currentStatus = WatcherServerStatus.Initializing;

            //
            // If the process was running do we then perform network checks.
            //
            Logger.Info($"{nameof(GenerateServerStatusUpdateAsync)} Checking server local network status at {registration.LocalEndpoint}");

            // get the server information direct from the server using local connection.
            GetLocalNetworkStatus(registration.GameFile, registration.LocalEndpoint, out QueryMaster.ServerInfo localInfo, out int onlinePlayerCount);

            if (localInfo != null)
            {
                currentStatus = WatcherServerStatus.RunningLocalCheck;

                //
                // Now that it's running, we can check the publication status.
                //
                Logger.Info($"{nameof(GenerateServerStatusUpdateAsync)} Checking server public status direct at {registration.SteamEndpoint}");

                // get the server information direct from the server using public connection.
                var serverStatus = CheckServerStatusDirect(registration.SteamEndpoint);
                // check if the server returned the information.
                if (!serverStatus)
                {
                    // server did not return any information
                    var nextExternalStatusQuery = _nextExternalStatusQuery.ContainsKey(registrationKey) ? _nextExternalStatusQuery[registrationKey] : DateTime.MinValue;
                    if (DateTime.Now >= nextExternalStatusQuery)
                    {
                        currentStatus = WatcherServerStatus.RunningExternalCheck;

                        if (!string.IsNullOrWhiteSpace(Config.Default.ServerStatusUrlFormat))
                        {
                            Logger.Info($"{nameof(GenerateServerStatusUpdateAsync)} Checking server public status via api at {registration.SteamEndpoint}");

                            // get the server information direct from the server using external connection.
                            var uri = new Uri(string.Format(Config.Default.ServerStatusUrlFormat, Config.Default.ServerManagerCode, App.Instance.Version, registration.SteamEndpoint.Address, registration.SteamEndpoint.Port));
                            serverStatus = await NetworkUtils.CheckServerStatusViaAPI(uri, registration.SteamEndpoint);
                        }

                        _nextExternalStatusQuery[registrationKey] = DateTime.Now.AddMilliseconds(Config.Default.ServerStatusWatcher_RemoteStatusQueryDelay);
                    }
                }

                // check if the server returned the information.
                if (serverStatus)
                {
                    currentStatus = WatcherServerStatus.Published;
                }
            }

            var statusUpdate = new ServerStatusUpdate
            {
                Process           = process,
                Status            = currentStatus,
                ServerInfo        = localInfo,
                OnlinePlayerCount = onlinePlayerCount,
            };

            return(await Task.FromResult(statusUpdate));
        }