Skip to content

Commit

Permalink
Merge pull request #105 from NECROBOTIO/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
GrimmGringo committed Aug 9, 2016
2 parents ce564a7 + 099b306 commit 8790d62
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 102 deletions.
84 changes: 48 additions & 36 deletions PoGo.NecroBot.CLI/Config/Translations/translation.pl.json
Expand Up @@ -22,7 +22,7 @@
},
{
"Key": "loginInvalid",
"Value": "Dane uwierzytelniania wygasły. Logowanie nie powiodło się."
"Value": "Dane uwierzytelniania wygasły. Logowanie nie powiodło się"
},
{
"Key": "farmPokestopsOutsideRadius",
Expand All @@ -34,11 +34,11 @@
},
{
"Key": "eventFortUsed",
"Value": "Nazwa: {0} [XP: {1}, Gemy: {2}, Itemy: {3}, Szerokość: {4}, Długość: {5}]"
"Value": "Nazwa: {0} [XP: {1}, Gemy: {2}, Itemy: {3}, Szerokość: {4}, Długość: {5}]"
},
{
"Key": "eventFortFailed",
"Value": "Nazwa: {0} INFO: Zbieranie przedmiotów nie powiodła sie, prawdopodobnie masz SoftBana. Odbanowanie za: {1}/{2}"
"Value": "Nazwa: {0} INFO: Zbieranie przedmiotów nie powiodła sie, prawdopodobnie masz SoftBana. Odbanowanie za: {1}/{2}"
},
{
"Key": "eventFortTargeted",
Expand All @@ -54,55 +54,55 @@
},
{
"Key": "eventUsedLuckyEgg",
"Value": "Użyto Lucky Egga, pozostało: {0}"
"Value": "Użyto LuckyEgga, pozostało: {0}"
},
{
"Key": "eventPokemonEvolvedSuccess",
"Value": "{0}. Otrzymujesz {1}XP"
},
{
"Key": "eventPokemonEvolvedFailed",
"Value": "Niepowodzenie! {0}. W rezultacie {1}, przestaję ewoluować {2}"
"Value": "Niepowodzenie {0}. W rezultacie {1}, przestaję ewoluować {2}"
},
{
"Key": "eventPokemonTransferred",
"Value": "{0}\t- CP: {1} IV: {2}% [Najlepszy z CP: {3} IV: {4}%] (Cukierki: {5})"
"Value": "{0}\t- CP: {1} IV: {2}% [Najlepszy z CP: {3} IV: {4}%] (Cukierki: {5})"
},
{
"Key": "eventItemRecycled",
"Value": "{0}x {1}"
},
{
"Key": "eventPokemonCaptureSuccess",
"Value": "({0}) | ({1}) {2} [Lvl: {3} | CP: ({4}/{5}) | IV: {6}%] Szansa: {7}% | Odległy o: {8}m | Użyto: {9} (Pozostało {10}) | EXP: {11} | {12} | Szerokość: {13} Długość: {14}"
"Value": "({0}) | ({1}) {2} [Lvl: {3} | CP: ({4}/{5}) | IV: {6}%] Szansa: {7}% | Odległy o: {8}m | Użyto: {9} (Pozostało {10}) | EXP: {11} | {12} | Szerokość: {13} Długość: {14}"
},
{
"Key": "eventPokemonCaptureFailed",
"Value": "({0}) | ({1}) {2} [Lvl: {3} | CP: ({4}/{5}) | IV: {6}%] Szansa: {7}% | Odległy o: {8}m | Użyto: {9} (Pozostało {10}) | Szerokość: {11} Długość: {12}"
"Value": "({0}) | ({1}) {2} [Lvl: {3} | CP: ({4}/{5}) | IV: {6}%] Szansa: {7}% | Odległy o: {8}m | Użyto: {9} (Pozostało {10}) | Szerokość: {11} Długość: {12}"
},
{
"Key": "eventNoPokeballs",
"Value": "Brak Pokeballi - Utracono {0} z CP: {1}"
"Value": "Brak Pokeballi - Utracono {0} CP: {1}"
},
{
"Key": "waitingForMorePokemonToEvolve",
"Value": "Pokemonów oczekujących na ewolucje: {0} | Możesz złapać ich jeszcze: {1} | {2}/{3} dla {4}% Ekwipunku"
"Value": "Pokemonów oczekujących na ewolucje: {0} | Możesz złapać ich jeszcze: {1} | {2}/{3} dla {4}% ekwipunku"
},
{
"Key": "useLuckyEggsMinPokemonAmountTooHigh",
"Value": "Lucky Egg nie zostanie użyty, gdy wartość UseLuckyEggsMinPokemonAmount wynosi {0}, użyj <= {1}"
"Value": "LuckyEgg nie zostanie użyty, gdy wartość UseLuckyEggsMinPokemonAmount wynosi {0}, użyj <= {1}"
},
{
"Key": "catchMorePokemonToUseLuckyEgg",
"Value": "Złap jeszcze {0} Pokemonów, żeby aktywowano Lucky Egga"
"Value": "Złap jeszcze {0} Pokemonów, żeby aktywowano LuckyEgga"
},
{
"Key": "eventUseBerry",
"Value": "Użyto {0} | Pozostało: {1}"
},
{
"Key": "itemRazzBerry",
"Value": "Jagoda"
"Value": "RazzBerry"
},
{
"Key": "catchStatusAttempt",
Expand Down Expand Up @@ -134,7 +134,7 @@
},
{
"Key": "commonWordUnknown",
"Value": "Nieznany"
"Value": "Nieznane"
},
{
"Key": "displayHighestsCpHeader",
Expand All @@ -150,7 +150,7 @@
},
{
"Key": "welcomeWarning",
"Value": "Upewnij się, że szerokość i długość geograficzna została wpisana poprawnie. Jeżeli nie to zamknij program [Szerokość: {0} Długość: {1}]"
"Value": "Upewnij się, że szerokość i długość geograficzna poprawnie. Jeżeli nie to zamknij program [Szerokość: {0} Długość: {1}]"
},
{
"Key": "incubatorPuttingEgg",
Expand All @@ -162,7 +162,7 @@
},
{
"Key": "incubatorEggHatched",
"Value": "Jajko wykluło się! Otrzymujesz {0} [Poziom: {1} CP: ({2}/{3}) IV: {4}%]"
"Value": "Jajko wykluło się! Otrzymujesz {0} [Poziom: {1} CP: ({2}/{3}) IV: {4}%]"
},
{
"Key": "logEntryError",
Expand Down Expand Up @@ -206,7 +206,7 @@
},
{
"Key": "logEntryBerry",
"Value": "JAGODA"
"Value": "Berry"
},
{
"Key": "logEntryEgg",
Expand Down Expand Up @@ -266,7 +266,7 @@
},
{
"Key": "notRealisticTravel",
"Value": "Nierealistyczne podróżowanie na {0}, używam Twojej ostatniej pozycji z 'LastPos.ini'"
"Value": "Nierealistyczne podróżowanie na {0}, używam Twojej ostatniej pozycji z pliku 'LastPos.ini'"
},
{
"Key": "coordinatesAreInvalid",
Expand Down Expand Up @@ -298,7 +298,7 @@
},
{
"Key": "updateFinished",
"Value": "Aktualizacja zakończona, możesz teraz zamknąć okno."
"Value": "Aktualizacja zakończona, możesz teraz zamknąć okno"
},
{
"Key": "lookingForIncensePokemon",
Expand All @@ -318,7 +318,7 @@
},
{
"Key": "zeroPokeballInv",
"Value": "Brak Pokeballi w Ekwipunku, nie możesz złapać więcej Pokemonów"
"Value": "Brak Pokeballi w ekwipunku, nie możesz złapać więcej Pokemonów"
},
{
"Key": "currentPokeballInv",
Expand All @@ -334,11 +334,11 @@
},
{
"Key": "currentMiscItemInv",
"Value": "Jagody: {0} | Incensy: {1} | LuckyEggy: {2} | Lury: {3}"
"Value": "RazzBerry: {0} | Incensy: {1} | LuckyEggi: {2} | Lury: {3}"
},
{
"Key": "maxItemsCombinedOverMaxItemStorage",
"Value": "[Błąd Konfiguracji] Ustawiona przez Ciebie dopuszczalna ilość itemów w Ekwipunku (PokeBalle+Potiony+Revivy={0}) przekracza maksymalną jego pojemność, która wynosi: ({1})"
"Value": "Ustawiona przez Ciebie dopuszczalna ilość itemów w ekwipunku (PokeBalle+Potiony+Revivy={0}) przekracza maksymalną jego pojemność, która wynosi: ({1})"
},
{
"Key": "recyclingQuietly",
Expand All @@ -354,7 +354,7 @@
},
{
"Key": "invFullPokestopLooting",
"Value": "Twoj Ekwipunek jest pełny, nie zebrano przedmiotów"
"Value": "Twoj ekwipunek jest pełny, nie zebrano przedmiotów"
},
{
"Key": "encounterProblem",
Expand All @@ -374,7 +374,7 @@
},
{
"Key": "pokemonFavorite",
"Value": "Dodano do Ulubionych: {1} [IV: {0}% | CP: {2}]"
"Value": "Dodano do Ulubionych: {1} [IV: {0}% | CP: {2}]"
},
{
"Key": "pokemonIgnoreFilter",
Expand Down Expand Up @@ -424,6 +424,18 @@
"Key": "statsTemplateString",
"Value": "{0} - Czas działania {1} - Poziom: {2} | XP na godzinę: {3:n0} | Pokemony na godzinę: {4:n0} | Stardust: {5:n0} | Przesłano: {6:n0} | Usunięto: {7:n0}"
},
{
"Key": "profileStatsTemplateString",
"Value": "----- LVL: {0} | {1} ----- \n Doświadczenie: {2}/{3} \n Złapanych Pokemonów: {4} \n Umieszczonych Pokemonów: {5} \n Odwiedzoncyh Pokestopów: {6} \n Wyklutych Jajek: {6} \n Wyewoluowanych Pokemonów: {7} \n Pokemonów w Pokedex: {8} \n Przebytych KM: {9}"
},
{
"Key": "showPokeTemplate",
"Value": "\n CP: {0} | Nazwa: {1}"
},
{
"Key": "helpTemplate",
"Value": "Komendy: \n \n /top <wartość> - Wyświetla top Twoich Pokemonów. \n /all - Wyświetla wszystkie posiadane Pokemony. \n /profile - Wyświetla Twój profil. \n /loc - Pokazuje Twoją pokalizację. \n /items - Wyświetla Twoje itemy"
},
{
"Key": "statsXpTemplateString",
"Value": "{0} (Następny poziom za {1}h {2}m) | {3:n0}/{4:n0} XP)"
Expand All @@ -434,35 +446,35 @@
},
{
"Key": "googleTwoFactorAuth",
"Value": "Na Twoim koncie Google aktywna jest weryfikacja dwuetapowa, będziesz musiał wprowadzić nowe hasło do aplikacji w 'auth.json'"
"Value": "Na Twoim koncie Google aktywna jest weryfikacja dwuetapowa, będziesz musiał wprowadzić nowe hasło w 'auth.json'"
},
{
"Key": "googleTwoFactorAuthExplanation",
"Value": "Otwieram hasła aplikacji Google. Proszę utworzyć nowe hasło aplikacji (Wybierz aplikację: Inna)"
},
{
"Key": "googleError",
"Value": "Upewnij się, że wpisany przez Ciebie Login i Hasło są prawidłowe."
"Value": "Upewnij się, że wpisany przez Ciebie Email i Hasło są prawidłowe"
},
{
"Key": "googleOffline",
"Value": "Google servers are probably down, Please be patient and start the bot later."
"Value": "Serwery Google są prawdopodobnie wyłączone, proszę uzbroić się w cierpliwość i uruchomić bota później"
},
{
"Key": "missingCredentialsGoogle",
"Value": "Wypełnij GoogleUsername oraz GooglePassword w 'auth.json'"
"Value": "Wprowadź GoogleUsername oraz GooglePassword w 'auth.json'"
},
{
"Key": "missingCredentialsPtc",
"Value": "Wypełnij PtcUsername oraz PtcPassword w 'auth.json'"
"Value": "Wprowadź PtcUsername oraz PtcPassword w 'auth.json'"
},
{
"Key": "snipeScan",
"Value": "Skanowanie w poszukiwaniu Pokemona [{0}]..."
},
{
"Key": "snipeScanEx",
"Value": "Mam na celowniku {0} z IV: {1} [{2}]..."
"Value": "Mam na celowniku {0} IV: {1} [{2}]..."
},
{
"Key": "noPokemonToSnipe",
Expand Down Expand Up @@ -490,19 +502,19 @@
},
{
"Key": "noEggsAvailable",
"Value": "Brak Lucky Eggów"
"Value": "Brak LuckyEggów"
},
{
"Key": "useLuckyEggActive",
"Value": "Lucky Egg jest aktywny"
"Value": "LuckyEgg jest aktywny"
},
{
"Key": "usedLuckyEgg",
"Value": "Aktywowano Lucky Egga"
"Value": "Aktywowano LuckyEgga"
},
{
"Key": "useLuckyEggAmount",
"Value": "Lucky Eggów w Ekwipunku: {0}"
"Value": "LuckyEggów w ekwipunku: {0}"
},
{
"Key": "noIncenseAvailable",
Expand All @@ -514,7 +526,7 @@
},
{
"Key": "useIncenseAmount",
"Value": "Incensów w Ekwipunku: {0}"
"Value": "Incensów w ekwipunku: {0}"
},
{
"Key": "usedIncense",
Expand Down Expand Up @@ -558,7 +570,7 @@
},
{
"Key": "firstStartAutoGenSettings",
"Value": "Musisz poczekać na automatyczne wygenerowanie plików 'config.json' / 'auth.json'..."
"Value": "Automatyczne generowanie plików 'config.json' i 'auth.json' z domyślnymi ustawieniami..."
},
{
"Key": "firstStartSetupAccount",
Expand Down
19 changes: 18 additions & 1 deletion PoGo.NecroBot.CLI/ConsoleLogger.cs
Expand Up @@ -13,11 +13,15 @@ namespace PoGo.NecroBot.CLI
/// <summary>
/// The ConsoleLogger is a simple logger which writes all logs to the Console.
/// </summary>
internal class ConsoleLogger : ILogger
public class ConsoleLogger : ILogger
{
private readonly LogLevel _maxLogLevel;
private ISession _session;

// Log write event definition.
public delegate void LogWriteHandler(object sender, LogWriteEventArgs e);
public event LogWriteHandler OnLogWrite;

/// <summary>
/// To create a ConsoleLogger, we must define a maximum log level.
/// All levels above won't be logged.
Expand Down Expand Up @@ -47,6 +51,9 @@ public void Write(string message, LogLevel level = LogLevel.Info, ConsoleColor c
if (level > _maxLogLevel)
return;

// Fire log write event.
OnLogWrite?.Invoke(this, new LogWriteEventArgs() { Message = message, Level = level, Color = color });

// ReSharper disable once SwitchStatementMissingSomeCases
switch (level)
{
Expand Down Expand Up @@ -130,4 +137,14 @@ public void lineSelect(int lineChar = 0, int linesUp = 1)
Console.SetCursorPosition(lineChar, Console.CursorTop - linesUp);
}
}

/// <summary>
/// Event args for Log Write Event.
/// </summary>
public class LogWriteEventArgs
{
public string Message { get; set; }
public LogLevel Level { get; set; }
public ConsoleColor Color { get; set; }
}
}
13 changes: 13 additions & 0 deletions PoGo.NecroBot.CLI/Plugin/INecroPlugin.cs
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PoGo.NecroBot.CLI.Plugin
{
public interface INecroPlugin
{
void Initialize(PluginInitializerInfo pii);
}
}
19 changes: 19 additions & 0 deletions PoGo.NecroBot.CLI/Plugin/PluginInitializerInfo.cs
@@ -0,0 +1,19 @@
using PoGo.NecroBot.Logic;
using PoGo.NecroBot.Logic.State;
using PoGo.NecroBot.Logic.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PoGo.NecroBot.CLI.Plugin
{
public class PluginInitializerInfo
{
public Session Session { get; set; }
public GlobalSettings Settings { get; set; }
public ConsoleLogger Logger { get; set; }
public Statistics Statistics { get; set; }
}
}

0 comments on commit 8790d62

Please sign in to comment.