Skip to content

Commit

Permalink
Merge pull request NecronomiconCoding#624 from samuraitruong/hmw-visu…
Browse files Browse the repository at this point in the history
…alizer

Human walk snipe with speed up option & visualizer support
  • Loading branch information
NoxxDev authored Aug 27, 2016
2 parents 587dcd8 + 197f6f4 commit a35a4a8
Show file tree
Hide file tree
Showing 51 changed files with 418 additions and 106 deletions.
2 changes: 1 addition & 1 deletion POGOProtos
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.da.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.el.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.et.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.kh.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.th.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Key": "HumanWalkSnipe",
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
"Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
},
{
"Key": "HumanWalkSnipeUpdate",
Expand Down
12 changes: 9 additions & 3 deletions PoGo.NecroBot.CLI/ConsoleEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ private static void HandleEvent(HumanWalkSnipeEvent ev, ISession session)
ev.Estimate / 60,
ev.Estimate % 60,
ev.SpinPokeStop ? "Yes" : "No",
ev.CatchPokemon ? "Yes" : "No"),
ev.CatchPokemon ? "Yes" : "No",
ev.WalkSpeedApplied),
LogLevel.Sniper,
ConsoleColor.Yellow);
break;
Expand All @@ -386,7 +387,7 @@ private static void HandleEvent(HumanWalkSnipeEvent ev, ISession session)

break;
case HumanWalkSnipeEventTypes.PokemonScanned:
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeUpdate, ev.RarePokemons.Count, 2, 3), LogLevel.Sniper, ConsoleColor.DarkMagenta);
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeUpdate, ev.Pokemons.Count, 2, 3), LogLevel.Sniper, ConsoleColor.DarkMagenta);
break;
case HumanWalkSnipeEventTypes.PokestopUpdated:
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeAddedPokestop, ev.NearestDistance, ev.Pokestops.Count), LogLevel.Sniper, ConsoleColor.Yellow);
Expand All @@ -395,7 +396,12 @@ private static void HandleEvent(HumanWalkSnipeEvent ev, ISession session)
case HumanWalkSnipeEventTypes.NotEnoughtPalls:
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeNotEnoughtBalls, ev.CurrentBalls, ev.MinBallsToSnipe), LogLevel.Sniper, ConsoleColor.Yellow);
break;

case HumanWalkSnipeEventTypes.EncounterSnipePokemon:
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipePokemonEncounted,
session.Translation.GetPokemonTranslation(ev.PokemonId),
ev.Latitude,
ev.Longitude));
break;
default:
break;
}
Expand Down
6 changes: 6 additions & 0 deletions PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SniperEventListener.cs" />
<Compile Include="ConsoleEventListener.cs" />
<Compile Include="ConsoleLogger.cs" />
<Compile Include="Models\LoggingStrings.cs" />
Expand All @@ -252,17 +253,22 @@
<Compile Include="SimpleSession.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebSocketHandler\ActionCommands\HumanSnipeRemovePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\HumanSnipePriorityPokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\FavoritePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\DropItemHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\SnipeListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\WebResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\EggListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\ItemListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\TrainerProfileResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetEggListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetPokemonSnipeListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetItemsListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetPokemonSettingsHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetTrainerProfileHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Helpers\TrainerProfileWeb.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetPokemonSnipeListTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetPokemonSettingsTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetTrainerProfileTask.cs" />
<Compile Include="WebSocketHandler\ActionCommands\EvolvePokemonHandler.cs" />
Expand Down
3 changes: 3 additions & 0 deletions PoGo.NecroBot.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,12 @@ private static void Main(string[] args)
ProgressBar.fill(50);
var listener = new ConsoleEventListener();
ProgressBar.fill(60);
var snipeEventListener = new SniperEventListener();

session.EventDispatcher.EventReceived += evt => listener.Listen(evt, session);
session.EventDispatcher.EventReceived += evt => aggregator.Listen(evt, session);
session.EventDispatcher.EventReceived += evt => snipeEventListener.Listen(evt, session);

if (settings.WebsocketsConfig.UseWebsocket)
{
var websocket = new WebSocketInterface(settings.WebsocketsConfig.WebSocketPort, session);
Expand Down
36 changes: 36 additions & 0 deletions PoGo.NecroBot.CLI/SniperEventListener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#region using directives

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 POGOProtos.Enums;
using POGOProtos.Inventory.Item;
using POGOProtos.Networking.Responses;
#endregion

namespace PoGo.NecroBot.CLI
{
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
internal class SniperEventListener
{
private static void HandleEvent(PokemonCaptureEvent pokemonCaptureEvent, ISession session)
{
//remove pokemon from list
Logic.Tasks.HumanWalkSnipeTask.UpdateCatchPokemon(pokemonCaptureEvent.Latitude, pokemonCaptureEvent.Longitude, pokemonCaptureEvent.Id);
}

internal void Listen(IEvent evt, ISession session)
{
dynamic eve = evt;

try
{ HandleEvent(eve, session); }
catch
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public FavoritePokemonHandler()

public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message)
{
await Logic.Tasks.FavoritePokemonTask.Execute(session, (ulong)message.PokemonId, (bool)message.Favorite);
await Logic.Tasks.HumanWalkSnipeTask.PriorityPokemon(session, (string)message.Id);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Threading.Tasks;
using PoGo.NecroBot.Logic.State;
using SuperSocket.WebSocket;
using POGOProtos.Inventory.Item;

namespace PoGo.NecroBot.CLI.WebSocketHandler.ActionCommands
{
public class HumanSnipePriorityPokemonHandler : IWebSocketRequestHandler
{
public string Command { get; private set;}

public HumanSnipePriorityPokemonHandler()
{
Command = "SnipePokemon";
}

public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message)
{
await Logic.Tasks.HumanWalkSnipeTask.TargetPokemonSnip(session, (string)message.Id);
await Task.Delay(1000);// Logic.Tasks.RecycleItemsTask.DropItem(session, (ItemId)message.ItemId, (int)message.Count);
}
}
}
Loading

0 comments on commit a35a4a8

Please sign in to comment.