Skip to content

Commit

Permalink
remove useless delays causing the bot to be slow
Browse files Browse the repository at this point in the history
  • Loading branch information
NecronomiconCoding committed Aug 2, 2016
1 parent d629322 commit 0ed2c54
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public static async Task Execute(ISession session, WebSocketSession webSocketSes
UnusedEggs = unusedEggs
};
webSocketSession.Send(EncodingHelper.Serialize(new EggListResponce(list,requestID)));

await Task.Delay(500);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public static async Task Execute(ISession session, WebSocketSession webSocketSes
{
var allItems = await session.Inventory.GetItems();
webSocketSession.Send(EncodingHelper.Serialize(new ItemListResponce(allItems, requestID)));
await Task.Delay(500);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public static async Task Execute(ISession session, WebSocketSession webSocketSes
var list = new List<PokemonListWeb>();
allPokemonInBag.ToList().ForEach(o => list.Add(new PokemonListWeb(o)));
webSocketSession.Send(EncodingHelper.Serialize(new PokemonListResponce(list,requestID)));

await Task.Delay(500);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public static async Task Execute(ISession session, WebSocketSession webSocketSes
Data = settings,
RequestID = requestID
}));

await Task.Delay(500);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public static async Task Execute(ISession session, WebSocketSession webSocketSes
return;
var tmpData = new TrainerProfileWeb(session.Profile.PlayerData, playerStats);
webSocketSession.Send(EncodingHelper.Serialize(new TrainerProfileResponce(tmpData, requestID)));
await Task.Delay(500);
}
}
}
2 changes: 0 additions & 2 deletions PoGo.NecroBot.Logic/Navigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public async Task<PlayerUpdateResponse> Move(GeoCoordinate targetLocation,

if (functionExecutedWhileWalking != null)
await functionExecutedWhileWalking(); // look for pokemon
await Task.Delay(500, cancellationToken);
} while (LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation) >= 30);

return result;
Expand Down Expand Up @@ -180,7 +179,6 @@ public async Task<PlayerUpdateResponse> HumanPathWalking(GpxReader.Trkpt trk,
if (functionExecutedWhileWalking != null)
await functionExecutedWhileWalking(); // look for pokemon & hit stops

await Task.Delay(500, cancellationToken);
} while (LocationUtils.CalculateDistanceInMeters(sourceLocation, targetLocation) >= 30);

return result;
Expand Down
1 change: 0 additions & 1 deletion PoGo.NecroBot.Logic/State/PositionCheckState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public async Task<IState> Execute(ISession session, CancellationToken cancellati
});
}
}
await Task.Delay(200, cancellationToken);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ public static async Task Start(Session session, CancellationToken cancellationTo
// most likely System.IO.IOException
session.EventDispatcher.Send(new ErrorEvent {Message = ex.ToString()});
}
await Task.Delay(5000, cancellationToken);
}
}
}
Expand Down

0 comments on commit 0ed2c54

Please sign in to comment.