internal bool SynchronizedReset() { var updated = false; this.EsiSynchronized = true; this.Owned = false; if (_fileSystemBlueprint == null) { return(updated); } else { updated = true; } FileSystemDataInterface.RemoveBlueprint(_fileSystemBlueprint); if (_eoiBlueprint != null) { _eoiBlueprint.MaterialEfficency = 0; _eoiBlueprint.TimeEfficency = 0; _eoiBlueprint.Owned = false; } return(updated); }
public EoiDataUser(FileSystemDataUser user) { _fileSystemUser = user; if (_fileSystemUser.TokenResponse != null) { var token = WebDataInterface.RefreshAccessToken(_fileSystemUser.TokenResponse.refresh_token); if (token != null) { if (this.Id == 0) { Authenticate(token); } _fileSystemUser.TokenResponse = token; FileSystemDataInterface.ExportUsers(); } } if (_fileSystemUser != null && _fileSystemUser.TokenResponse != null) { CorporationWebInterface.RegisterUser(_fileSystemUser.Name); } this.Name = user.Name; }
internal void Delete() { if (_fileSystemAsset != null) { FileSystemDataInterface.RemoveAsset(_fileSystemAsset); } }
private static void InitializeUsers() { _eoiDataUsers = new List <EoiDataUser>(); var users = FileSystemDataInterface.GetUsers(); foreach (var user in users) { _eoiDataUsers.Add(new EoiDataUser(user)); } }
private static void InitializeAssets() { _eoiDataAsset = new List <EoiDataAsset>(); var assets = FileSystemDataInterface.GetAssets(); foreach (var asset in assets) { _eoiDataAsset.Add(new EoiDataAsset(asset)); } }
internal bool Synchronize(EsiDataBlueprint blueprint) { var updated = false; if (blueprint == null) { return(false); } this.EsiSynchronized = true; if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } if (_fileSystemBlueprint.MaterialEfficency != blueprint.MaterialEfficency) { _fileSystemBlueprint.MaterialEfficency = blueprint.MaterialEfficency; if (_eoiBlueprint != null) { _eoiBlueprint.MaterialEfficency = blueprint.MaterialEfficency; } updated = true; } if (_fileSystemBlueprint.TimeEfficency != blueprint.TimeEfficency) { _fileSystemBlueprint.TimeEfficency = blueprint.TimeEfficency; if (_eoiBlueprint != null) { _eoiBlueprint.TimeEfficency = blueprint.TimeEfficency; } updated = true; } if (!this.Owned) { _fileSystemBlueprint.Owned = true; this.Owned = true; if (_eoiBlueprint != null) { _eoiBlueprint.Owned = true; } updated = true; } return(updated); }
public static void Init() { StaticDataInterface.Init(); FileSystemDataInterface.Init(); InitializeEoiData(); EsiDataInterface.Init(); InitEoiDataContent(); }
private static void CreateDefaultUser() { FileSystemDataInterface.CreateDefaultUser(); var user = FileSystemDataInterface.GetUsers().FirstOrDefault(x => x.Name == "Default"); if (user != null) { var eoiDataUser = new EoiDataUser(user); _eoiDataUsers.Add(eoiDataUser); EoiInterface.AddUser(eoiDataUser.GetEoiUser()); } }
public EoiDataAsset(RawEsiAsset esiAsset) { if (esiAsset != null) { this.Id = esiAsset.type_id; _type = EoiDataInterface.GetTypeById(this.Id); if (_fileSystemAsset == null) { _fileSystemAsset = FileSystemDataInterface.CreateAsset(esiAsset.type_id, esiAsset.quantity); } } }
internal void Synchronize(RawEsiAsset esiAsset) { if (esiAsset.type_id != this.Id) { return; } if (_fileSystemAsset == null) { _fileSystemAsset = FileSystemDataInterface.CreateAsset(esiAsset.type_id, esiAsset.quantity); } else { _fileSystemAsset.Quantity += esiAsset.quantity; } }
internal void Init() { var region = Regions.GetTradehubRegionId(SolarSystems.GetSolarSystem(SettingsInterface.GlobalSettings.TradeHub)); var marketOrders = EsiDataInterface.GetMarketOrders(Id, region); if (marketOrders != null) { _esiMarketOrders.Add(marketOrders); } _fileSystemBlueprint = FileSystemDataInterface.GetBlueprintById(Id); if (_fileSystemBlueprint != null && _fileSystemBlueprint.IsCopy) { this.IsCopy = true; } }
private void EoiBlueprint_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(EoiBlueprint.Private)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.Private = _eoiBlueprint.Private; } else if (e.PropertyName == nameof(EoiBlueprint.Owned)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.Owned = _eoiBlueprint.Owned; this.Owned = _eoiBlueprint.Owned; } else if (e.PropertyName == nameof(EoiBlueprint.MaterialEfficency)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.MaterialEfficency = _eoiBlueprint.MaterialEfficency; BlueprintCalculator.Calculate(this); } else if (e.PropertyName == nameof(EoiBlueprint.TimeEfficency)) { if (_fileSystemBlueprint == null) { _fileSystemBlueprint = FileSystemDataInterface.CreateBlueprint(this.Id); } _fileSystemBlueprint.TimeEfficency = _eoiBlueprint.TimeEfficency; BlueprintCalculator.Calculate(this); } }
internal void VerifyUser(RawEsiVerify verifyResult, RawAccessTokenResponse token) { _fileSystemUser.TokenResponse = token; _fileSystemUser.Name = verifyResult.CharacterName; _fileSystemUser.Id = verifyResult.CharacterID; FileSystemDataInterface.ExportUsers(); this.Id = verifyResult.CharacterID; this.Name = verifyResult.CharacterName; if (_eoiUser != null) { _eoiUser.Name = verifyResult.CharacterName; _eoiUser.IsDefault = false; _eoiUser.Authenticated = true; _eoiUser.InvokePropertyChanged(); } CorporationWebInterface.RegisterUser(_fileSystemUser.Name); }
internal void CheckAccessToken() { if (_fileSystemUser.TokenResponse != null) { var difference = DateTime.Now - _fileSystemUser.TokenResponse.Timestamp; if (difference.TotalMinutes >= 15) { var token = WebDataInterface.RefreshAccessToken(_fileSystemUser.TokenResponse.refresh_token); if (token != null) { if (this.Id == 0) { Authenticate(token); } _fileSystemUser.TokenResponse = token; FileSystemDataInterface.ExportUsers(); } } } }
internal static void Close() { FileSystemDataInterface.Close(); }