public EveClientDownloader(EveServer server) { Server = server; HttpClientHandler handler = new HttpClientHandler { AllowAutoRedirect = true, }; _httpClient = new HttpClient(handler, true); _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "EveClientDownloader/1.0 (https://github.com/Eve-Utils/EveClientDownloader)"); BuildUrl = string.Format("https://binaries.eveonline.com/eveclient_{0}.json", Abbreviation[Server]); }
/// <summary> /// Called when the server status updated. /// </summary> /// <param name="server">The server.</param> /// <param name="previousStatus">The previous status.</param> /// <param name="status">The status.</param> internal static void OnServerStatusUpdated(EveServer server, ServerStatus previousStatus, ServerStatus status) { if (Closed) return; Trace(); ServerStatusUpdated?.ThreadSafeInvoke(null, new EveServerEventArgs(server, previousStatus, status)); }
/// <summary> /// Constructor. /// </summary> /// <param name="server"></param> /// <param name="previousStatus"></param> /// <param name="status"></param> public EveServerEventArgs(EveServer server, ServerStatus previousStatus, ServerStatus status) { Server = server; Status = status; PreviousStatus = previousStatus; }
/// <summary> /// Initializes paths, static objects, check and load datafiles, etc. /// </summary> /// <remarks>May be called more than once without causing redundant operations to occur.</remarks> public static void Initialize() { if (s_initialized) return; s_initialized = true; Trace("begin"); // Network monitoring (connection availability changes) NetworkMonitor.Initialize(); // APIMethods collection initialization (always before members instatiation) APIMethods.Initialize(); // Members instantiations APIProviders = new GlobalAPIProviderCollection(); MonitoredCharacters = new GlobalMonitoredCharacterCollection(); CharacterIdentities = new GlobalCharacterIdentityCollection(); Notifications = new GlobalNotificationCollection(); Characters = new GlobalCharacterCollection(); Datafiles = new GlobalDatafileCollection(); APIKeys = new GlobalAPIKeyCollection(); EVEServer = new EveServer(); Trace("done"); }