This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update module ferox for new heads * move logic submodule to folder * move logic submodule to folder pt2 * base submodule feroxrev * update, common requests have changed: - checkChallenge is not more - downloadSettings is always there now * release RB * new api support * set versionint * base modules
- Loading branch information
Showing
384 changed files
with
45,489 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule FeroxRev
updated
3 files
+3 −3 | Constants.cs | |
+4 −4 | PokemonGo.RocketAPI.csproj | |
+2 −2 | packages.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule PoGo.NecroBot.Logic
deleted from
5326e9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using PoGo.NecroBot.Logic.State; | ||
using System; | ||
using System.Runtime.Caching; | ||
using TinyIoC; | ||
|
||
namespace PoGo.NecroBot.Logic | ||
{ | ||
public class Caching | ||
{ | ||
private const int CACH_DURATION = 15; //minutes | ||
private static MemoryCache encounteredPokemons = new MemoryCache("encounteredPokemons"); | ||
|
||
public static void AddEncounteredPokemon(ulong encounterId) | ||
{ | ||
ISession session = TinyIoCContainer.Current.Resolve<ISession>(); | ||
string uniqueKey = $"{session.Settings.Username}-{encounterId}"; | ||
encounteredPokemons.Add(uniqueKey, encounterId, DateTime.Now.AddMinutes(CACH_DURATION)); | ||
|
||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
PoGo.NecroBot.Logic/Captcha/Anti-Captcha/AntiCaptchaClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using PoGo.NecroBot.Logic.Logging; | ||
using System.Threading.Tasks; | ||
|
||
namespace PoGo.NecroBot.Logic.Captcha.Anti_Captcha | ||
{ | ||
public class AntiCaptchaClient | ||
{ | ||
|
||
private const string Host = "api.anti-captcha.com"; | ||
//private string ClientKey = "xxxxxxx"; | ||
private const string ProxyHost = "xx.xx.xx.xx"; | ||
private const int ProxyPort = 8282; | ||
private const string ProxyLogin = ""; | ||
private const string ProxyPassword = ""; | ||
|
||
private const string UserAgent = | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36" | ||
; | ||
|
||
|
||
public static async Task<string> SolveCaptcha(string captchaURL, string apiKey, string googleSiteKey, | ||
string proxyHost, int proxyPort, string proxyAccount = "", string proxyPassword = "") | ||
{ | ||
var task1 = AnticaptchaApiWrapper.CreateNoCaptchaTaskProxyless( | ||
Host, | ||
apiKey, | ||
captchaURL, //target website address | ||
googleSiteKey, | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36" | ||
); | ||
|
||
return await ProcessTask(task1, apiKey).ConfigureAwait(false); | ||
} | ||
|
||
private static async Task<string> ProcessTask(AnticaptchaTask task, string apikey) | ||
{ | ||
AnticaptchaResult response; | ||
|
||
do | ||
{ | ||
response = AnticaptchaApiWrapper.GetTaskResult(Host, apikey, task); | ||
|
||
if (response.GetStatus().Equals(AnticaptchaResult.Status.ready)) | ||
{ | ||
break; | ||
} | ||
|
||
await Task.Delay(3000).ConfigureAwait(false); | ||
} while (response != null && response.GetStatus().Equals(AnticaptchaResult.Status.processing)); | ||
|
||
if (response == null || response.GetSolution() == null) | ||
{ | ||
Logger.Write("Unknown error occurred...", LogLevel.Error); | ||
//Console.WriteLine("Response dump:"); | ||
//Console.WriteLine(response); | ||
} | ||
else | ||
{ | ||
//Console.WriteLine("The answer is '" + response.GetSolution() + "'"); | ||
} | ||
|
||
return response.GetSolution(); | ||
} | ||
} | ||
} |
Oops, something went wrong.