Skip to content

Commit

Permalink
Merge pull request #3953 from jjskuld/bug_fix/pokezz_close_socket
Browse files Browse the repository at this point in the history
Fix pokezz sniping socket bug
  • Loading branch information
GrimmGringo committed Aug 9, 2016
2 parents 34d5bf0 + 5bc6f89 commit 47e9d5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
Bounds = new Location(location.Latitude, location.Longitude),
PokemonId = location.Id,
Source = "PokeSnipers.com",
//Iv = location.IV
Iv = location.IV
});

if (!await CheckPokeballsToSnipe(session.LogicSettings.MinPokeballsWhileSnipe + 1,
Expand Down Expand Up @@ -528,6 +528,7 @@ private static List<SniperInfo> GetSniperInfoFrom_pokezz(ISession session, List<

socket.On("pokemons", (msg) =>
{
socket.Close();
JArray data = JArray.FromObject(msg);
foreach (var pokeToken in data.Children())
{
Expand All @@ -541,12 +542,14 @@ private static List<SniperInfo> GetSniperInfoFrom_pokezz(ISession session, List<

socket.On(Quobject.SocketIoClientDotNet.Client.Socket.EVENT_ERROR, () =>
{
socket.Close();
hasError = true;
waitforbroadcast.Set();
});

socket.On(Quobject.SocketIoClientDotNet.Client.Socket.EVENT_CONNECT_ERROR, () =>
{
socket.Close();
hasError = true;
waitforbroadcast.Set();
});
Expand Down

0 comments on commit 47e9d5f

Please sign in to comment.