public Service() { ServiceName = SERVICE_NAME; POGOLib.Logging.Logger.RegisterLogOutput((level, msg) => { log.Info($"POGOLib, {level} - {msg}"); }); instances = new List <PogoInstance>(); var mainConfiguration = MainConfiguration.Load(); foreach (var configuration in mainConfiguration.Instances) { configuration.MainConfiguration = mainConfiguration; instances.Add(new PogoInstance(configuration)); } }
public PokemonGoService() { var config = MainConfiguration.Load(); pogoInstances = new List <PogoInstance>(config.Instances.Count); foreach (var instance in config.Instances) { instance.MainConfiguration = config; var walker = new Walker(instance.WalkingPoints); var startPosition = walker.GetNextPosition(); var session = Login.GetSession(instance.Username, instance.Password, instance.LoginProvider, startPosition.Latitude, startPosition.Longitude); var pogoInstance = new PogoInstance(instance, session, walker); pogoInstances.Add(pogoInstance); } }