diff --git a/PoGo.NecroBot.CLI/Program.cs b/PoGo.NecroBot.CLI/Program.cs index c9b5aef43..60fc489fb 100644 --- a/PoGo.NecroBot.CLI/Program.cs +++ b/PoGo.NecroBot.CLI/Program.cs @@ -246,7 +246,7 @@ private static void Main(string[] args) if (settings.TelegramConfig.UseTelegramAPI) _session.Telegram = new TelegramService(settings.TelegramConfig.TelegramAPIKey, _session); - if (_session.LogicSettings.UseSnipeLocationServer) + if (_session.LogicSettings.UseSnipeLocationServer || _session.LogicSettings.HumanWalkingSnipeUsePogoLocationFeeder) SnipePokemonTask.AsyncStart(_session); settings.checkProxy(_session.Translation); diff --git a/PoGo.NecroBot.CLI/SniperEventListener.cs b/PoGo.NecroBot.CLI/SniperEventListener.cs index b27d54f9a..c1c670ff2 100644 --- a/PoGo.NecroBot.CLI/SniperEventListener.cs +++ b/PoGo.NecroBot.CLI/SniperEventListener.cs @@ -2,10 +2,14 @@ using System; using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using PoGo.NecroBot.Logic.Common; using PoGo.NecroBot.Logic.Event; +using PoGo.NecroBot.Logic.Logging; using PoGo.NecroBot.Logic.State; -using PoGo.NecroBot.Logic.Tasks; - +using POGOProtos.Enums; +using POGOProtos.Inventory.Item; +using POGOProtos.Networking.Responses; #endregion namespace PoGo.NecroBot.CLI @@ -16,22 +20,28 @@ internal class SniperEventListener private static void HandleEvent(PokemonCaptureEvent pokemonCaptureEvent, ISession session) { //remove pokemon from list - HumanWalkSnipeTask.UpdateCatchPokemon(pokemonCaptureEvent.Latitude, pokemonCaptureEvent.Longitude, - pokemonCaptureEvent.Id); + Logic.Tasks.HumanWalkSnipeTask.UpdateCatchPokemon(pokemonCaptureEvent.Latitude, pokemonCaptureEvent.Longitude, pokemonCaptureEvent.Id); } + public static void HandleEvent(SnipePokemonFoundEvent ev, ISession session) + { + Logic.Tasks.HumanWalkSnipeTask.AddSnipePokemon("Local Feeder", + ev.PokemonFound.Id, + ev.PokemonFound.Latitude, + ev.PokemonFound.Longitude, + ev.PokemonFound.ExpirationTimestamp, + ev.PokemonFound.IV, + session + ); + } internal void Listen(IEvent evt, ISession session) { dynamic eve = evt; try - { - HandleEvent(eve, session); - } - catch (Exception) - { - // ignored - } + { HandleEvent(eve, session); } + catch + { } } } -} \ No newline at end of file +} diff --git a/PoGo.NecroBot.GUI/PoGo.NecroBot.GUI.csproj b/PoGo.NecroBot.GUI/PoGo.NecroBot.GUI.csproj index d00b1b3e4..96af667c3 100644 --- a/PoGo.NecroBot.GUI/PoGo.NecroBot.GUI.csproj +++ b/PoGo.NecroBot.GUI/PoGo.NecroBot.GUI.csproj @@ -155,6 +155,8 @@ + +