Skip to content

Commit

Permalink
Add yours walking strategy as a fallback/alternative for Google walki…
Browse files Browse the repository at this point in the history
…NecronomiconCoding#429 Merge branch 'jjskuld-feature/add_multiple_walking_strategies'
  • Loading branch information
NoxxDev committed Aug 23, 2016
2 parents fe6c794 + 8ff66c0 commit 9ed91f0
Show file tree
Hide file tree
Showing 47 changed files with 446 additions and 199 deletions.
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Viatjant cap a la Pokeparada: {0} ({1}m)({2}segons)"
"Value": "Viatjant cap a la Pokeparada: {0} ({1}m) ({2}segons) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Chůze k Pokestopu: {0} ({1}m) ({2} sekund)"
"Value": "Chůze k Pokestopu: {0} ({1}m) ({2} sekund) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -78,7 +78,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} om ({1}m) ({2}sekunder)"
"Value": "{0} om ({1}m) ({2}sekunder) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} in ({1}m) ({2} Sekunden)"
"Value": "{0} in ({1}m) ({2} Sekunden) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} σε απόσταση {1} μέτρων"
"Value": "{0} σε απόσταση {1} μέτρων ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Llegando a Poképarada: {0} en ({1}m) ({2} segundos)"
"Value": "Llegando a Poképarada: {0} en ({1}m) ({2} segundos) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -78,7 +78,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} ({1} m pärast)"
"Value": "{0} ({1} m pärast) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} à {1}m | {2}s"
"Value": "{0} à {1}m | {2}s (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Erkezes pokestopphoz: {0} ({1}m)"
"Value": "Erkezes pokestopphoz: {0} ({1}m) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.id.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Jalan ke PokeStop {0}, {1} meter, {2} detik"
"Value": "Jalan ke PokeStop {0}, {1} meter, {2} detik (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Camminando verso il Pokestop: {0} ({1}m) ({2} secondi)"
"Value": "Camminando verso il Pokestop: {0} ({1}m) ({2} secondi) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "次のポケストップへ移動中です: {0} ({1}m) ({2} 秒)"
"Value": "次のポケストップへ移動中です: {0} ({1}m) ({2} 秒) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -56,7 +56,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "ធ្វើដំណើរទៅ PokeStop: {0} ({1}វិនារទី)"
"Value": "ធ្វើដំណើរទៅ PokeStop: {0} ({1}វិនារទី) ({2} seconds) (route {3})"

},
{
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 @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Atvykstama į Pokestotelę: {0} už ({1}m)"
"Value": "Atvykstama į Pokestotelę: {0} už ({1}m) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} over {1} meter ({2} seconden)"
"Value": "{0} over {1} meter ({2} seconden) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{0} in ({1}m)"
"Value": "{0} in ({1}m) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Config/Translations/translation.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Dotarcie do PokeStopu: {0} za ({1}m) ({2}s)"
"Value": "Dotarcie do PokeStopu: {0} za ({1}m) ({2}s) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Chegando ao Pokestop: {0} ({1}m) ({2} segundos)"
"Value": "Chegando ao Pokestop: {0} ({1}m) ({2} segundos) (rota {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "A chegar ao Pokestop: {0} em ({1}m)"
"Value": "A chegar ao Pokestop: {0} em ({1}m) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Călătoresc la pokestopul \"{0}\" ({1}m) ({2} secunde)"
"Value": "Călătoresc la pokestopul \"{0}\" ({1}m) ({2} secunde) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Направляемся к <{0}>, дистанция ({1}м) ({2} сек.)"
"Value": "Направляемся к <{0}>, дистанция ({1}м) ({2} сек.) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Anländer till Pokestop: {0} om ({1}m)"
"Value": "Anländer till Pokestop: {0} om ({1}m) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "กำลังเดินทางไปสู่ PokeStops : {0} ( {1} เมตร ) ( {2} วินาที )"
"Value": "กำลังเดินทางไปสู่ PokeStops : {0} ( {1} เมตร ) ( {2} วินาที ) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "{2} saniye sonra {1}m mesafedeki \"{0}\" adlı PokéStop'a varılacak."
"Value": "(route {3}) {2} saniye sonra {1}m mesafedeki \"{0}\" adlı PokéStop'a varılacak."
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Прямуємо до <{0}>, дистанція ({1} м)"
"Value": "Прямуємо до <{0}>, дистанція ({1} м) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
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 @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "Đi đến Pokestop: {0} (xa {1}m) (trong {2} giây)"
"Value": "Đi đến Pokestop: {0} (xa {1}m) (trong {2} giây) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "正在前往补给站:{0} 距离{1}米,需要{2}秒\t\t\t"
"Value": "正在前往补给站:{0} 距离{1}米,需要{2}秒 (route {3})\t\t\t"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "正在前往补给站:{0} 距离{1}米,需要{2}秒\t\t\t"
"Value": "正在前往补给站:{0} 距离{1}米,需要{2}秒 (route {3})\t\t\t"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "前往補給站:{0} (距離{1}公尺)"
"Value": "前往補給站:{0} (距離{1}公尺) ({2} seconds) (route {3})"
},
{
"Key": "eventProfileLogin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
{
"Key": "eventFortTargeted",
"Value": "前往補給站:{0} (距離{1}公尺,需要{2}秒)\t\t\t\t"
"Value": "前往補給站:{0} (距離{1}公尺,需要{2}秒) (route {3})\t\t\t\t"
},
{
"Key": "eventProfileLogin",
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/ConsoleEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static void HandleEvent(FortTargetEvent fortTargetEvent, ISession sessio

Logger.Write(
session.Translation.GetTranslation(TranslationString.EventFortTargeted, fortTargetEvent.Name,
Math.Round(fortTargetEvent.Distance), intTimeForArrival),
Math.Round(fortTargetEvent.Distance), intTimeForArrival, fortTargetEvent.Route),
LogLevel.Info, ConsoleColor.Gray);
}

Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Common/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public class Translation : ITranslation
new KeyValuePair<TranslationString, string>(TranslationString.EventFortFailed,
"Name: {0} INFO: Looting failed, possible softban. Unban in: {1}/{2}"),
new KeyValuePair<TranslationString, string>(TranslationString.EventFortTargeted,
"Traveling to Pokestop: {0} ({1}m) ({2} seconds)"),
"Traveling to Pokestop: {0} ({1}m) ({2} seconds) (route {3})"),
new KeyValuePair<TranslationString, string>(TranslationString.EventProfileLogin, "Playing as {0}"),
new KeyValuePair<TranslationString, string>(TranslationString.EventUsedIncense,
"Used Incense, remaining: {0}"),
Expand Down
1 change: 1 addition & 0 deletions PoGo.NecroBot.Logic/Event/FortTargetEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
public class FortTargetEvent : IEvent
{
public string Route;
public double Distance;
public string Name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public interface ILogicSettings
bool UseGoogleWalkCache { get; }
string GoogleApiKey { get; }
string GoogleHeuristic { get; }

bool UseYoursWalk { get; }
string YoursWalkHeuristic { get; }
string YoursServerUrl { get; }

int ResumeTrack { get; }
int ResumeTrackSeg { get; }
int ResumeTrackPt { get; }
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Model/Google/Teste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class Teste
{
public static void Testar(ISession session)
{
var googleDirectionsService = new DirectionsService(session);
var googleDirectionsService = new GoogleDirectionsService(session);

var googleResult = googleDirectionsService.GetDirections(new GeoCoordinate(40.780599, -73.968862), new List<GeoCoordinate>(), new GeoCoordinate(40.781939, -73.965123));
var googleWalk = GoogleWalk.Get(googleResult);
Expand Down
1 change: 1 addition & 0 deletions PoGo.NecroBot.Logic/Model/Settings/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class GlobalSettings
public PlayerConfig PlayerConfig = new PlayerConfig();
public SoftBanConfig SoftBanConfig = new SoftBanConfig();
public GoogleWalkConfig GoogleWalkConfig = new GoogleWalkConfig();
public YoursWalkConfig YoursWalkConfig = new YoursWalkConfig();

public List<KeyValuePair<ItemId, int>> ItemRecycleFilter = new List<KeyValuePair<ItemId, int>>
{
Expand Down
5 changes: 5 additions & 0 deletions PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public LogicSettings(GlobalSettings settings)
public bool UseGoogleWalkCache => _settings.GoogleWalkConfig.Cache;
public string GoogleApiKey => _settings.GoogleWalkConfig.GoogleAPIKey;
public string GoogleHeuristic => _settings.GoogleWalkConfig.GoogleHeuristic;

public bool UseYoursWalk => _settings.YoursWalkConfig.UseYoursWalk;
public string YoursWalkHeuristic => _settings.YoursWalkConfig.YoursWalkHeuristic;
public string YoursServerUrl => _settings.YoursWalkConfig.YoursServerUrl;

public bool SnipeAtPokestops => _settings.SnipeConfig.SnipeAtPokestops;

public bool UseTelegramAPI => _settings.TelegramConfig.UseTelegramAPI;
Expand Down
11 changes: 11 additions & 0 deletions PoGo.NecroBot.Logic/Model/Settings/YoursWalkConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace PoGo.NecroBot.Logic.Model.Settings
{
/// <summary>
/// </summary>
public class YoursWalkConfig
{
public bool UseYoursWalk = false;
public string YoursWalkHeuristic = "bicycle";
public string YoursServerUrl = "http://www.yournavigation.org/api/dev/route.php";
}
}
Loading

0 comments on commit 9ed91f0

Please sign in to comment.