Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x #5

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open

x #5

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
d3abfad
Move CatchPokemonRoutine into the FarmingPokestops to find more Pokemon
FeroxRev Jul 19, 2016
f65e3f3
Merge branch 'master' of https://github.com/FeroxRev/PokemonGo.Rocket…
FeroxRev Jul 19, 2016
ea2480b
Fix packages
FeroxRev Jul 19, 2016
c482d50
Update README.md
FeroxRev Jul 19, 2016
a999b0a
Fix server hickup handling and retry
FeroxRev Jul 19, 2016
686be4c
Merge branch 'master' of https://github.com/FeroxRev/PokemonGo.Rocket…
FeroxRev Jul 19, 2016
61c6ae9
Reflect proper functionality of FarmPokestops
FeroxRev Jul 19, 2016
030b17f
Fix RetryHandler.cs for PTC Login to allow HttpStatusCode 302
FeroxRev Jul 19, 2016
4cfe92c
Update README.md
FeroxRev Jul 19, 2016
131ef14
Make Pokeball Throws Great Again
davidmann4 Jul 19, 2016
4e09a23
Merge pull request #5 from davidmann4/master
FeroxRev Jul 19, 2016
ab8e2c0
Added switch between PTC and google login. Developers can now just ig…
ArcticXWolf Jul 19, 2016
764c822
Merge pull request #11 from ArcticXWolf/master
FeroxRev Jul 19, 2016
67961f8
Merge commit
FeroxRev Jul 19, 2016
512be5e
Added friendly name pokemon in output console.
Jul 19, 2016
c889263
Merge pull request #14 from pkiers/pr/friendly-name
FeroxRev Jul 19, 2016
bee876e
Fixed type for method,. (#16)
pkiers Jul 19, 2016
0d882fe
Make the "GetFriendlyItemsString" better. (#21)
cameronsjo Jul 20, 2016
1446434
Add login by refresh token (#33)
DaniilSokolyuk Jul 20, 2016
695def0
Fixed id of pokemon in inventory. Renamed pokemonId to pokemonType. (…
ArcticXWolf Jul 20, 2016
4ea4ce5
Transfer Duplicates
thetemplar Jul 20, 2016
19825f8
added transfer and evolve to client
martin-podlubny Jul 20, 2016
43340ee
added program methods for transfering and evolving all given pokemon
martin-podlubny Jul 20, 2016
48172c0
Refactor Google Login
FeroxRev Jul 20, 2016
81c3fc6
add program transfer all but strongest unwanted pokemon
martin-podlubny Jul 20, 2016
ea18bc0
Fix merge commit
FeroxRev Jul 20, 2016
bb0bafe
Simple option to choose used pokeball while catching. (#49)
ArcticXWolf Jul 20, 2016
e950e36
added time stamps to console informations. (#55)
azmanomer Jul 20, 2016
0533e32
Renamed enums to pokemonType according to earlier commit. (#54)
ArcticXWolf Jul 20, 2016
6ee94c3
Refactor PTC Login
FeroxRev Jul 20, 2016
dcaa2e6
Fix erroneous request header for PTC login
FeroxRev Jul 20, 2016
c3d9e97
Update README.md
FeroxRev Jul 20, 2016
2d0ab55
#57 Implemented ISettings Interface
jshield Jul 20, 2016
a7759b9
Added enums/proto, refactored to work with new proto files
FeroxRev Jul 20, 2016
40a778c
Merge branch 'master' of https://github.com/FeroxRev/PokemonGo.Rocket…
FeroxRev Jul 20, 2016
8a1a05b
ISettings merge
FeroxRev Jul 20, 2016
32b30f9
Remove PokeBallType from settings
FeroxRev Jul 20, 2016
8dccef9
Remove GetFriendlyName - Enum is already friendly
FeroxRev Jul 20, 2016
c8f15ac
Change Settings to AppConfigSettings, so that it can save the GoogleR…
FeroxRev Jul 20, 2016
1045555
Add Request call logging to console
FeroxRev Jul 20, 2016
d870c92
Add PTC server down logging
FeroxRev Jul 20, 2016
480eb56
Use CallerMemberName Attribute so you do not have any magic strings i…
jshield Jul 20, 2016
7268144
[FIX] so double.Parse will work with . for all cultures. (#75)
Tazer Jul 20, 2016
847f4c9
Merge branch
FeroxRev Jul 20, 2016
bad3bac
Merge fix
FeroxRev Jul 20, 2016
a6e1436
Merge fix
FeroxRev Jul 20, 2016
155e324
Merge fix
FeroxRev Jul 20, 2016
f369bbe
Merge fix, UNTESTED, please someone confirm..
FeroxRev Jul 20, 2016
1ba888a
Evolves & Transfers all Pokemon now
NecronomiconCoding Jul 20, 2016
a7cce3e
Charmender Typo fix
NecronomiconCoding Jul 20, 2016
ed3bba6
Updated Readme
NecronomiconCoding Jul 20, 2016
16de09f
Added Update Check
NecronomiconCoding Jul 20, 2016
743058f
Code Cleanup
NecronomiconCoding Jul 20, 2016
bb0dddc
clarified readme
NecronomiconCoding Jul 20, 2016
e54ef67
Hotfix
NecronomiconCoding Jul 20, 2016
e4fb2df
Merge remote-tracking branch 'refs/remotes/NecronomiconCoding/master'
Hardell Jul 20, 2016
2912e92
CP Transferring, better settings.
Hardell Jul 20, 2016
852b24c
Fixed default CP threshold
Hardell Jul 20, 2016
99dd939
Updated Readme
NecronomiconCoding Jul 20, 2016
f3f936d
Clarified settings in readme
Hardell Jul 20, 2016
de731b3
Clarified settings
Hardell Jul 20, 2016
4df9e21
Merge pull request #3 from Hardell/master
NecronomiconCoding Jul 20, 2016
5e754a5
Version Update
NecronomiconCoding Jul 20, 2016
7451f44
Merge remote-tracking branch 'refs/remotes/NecronomiconCoding/master'
Hardell Jul 20, 2016
c863377
Typo Fixes
NecronomiconCoding Jul 20, 2016
300c6f4
Added a disable option for transfers. Described all transfer types in…
Hardell Jul 20, 2016
b7b4e02
One more type in readme.
Hardell Jul 20, 2016
a8707d0
Added Clearer Indicator of CP value after Catch
NecronomiconCoding Jul 20, 2016
ab4f8a9
Merge pull request #5 from Hardell/master
NecronomiconCoding Jul 20, 2016
c00f3fc
Updated readme format
Hardell Jul 20, 2016
3c4f87c
Using AuthType from App.Config instead of Hardcoding
DorianLoeben Jul 20, 2016
278f417
Merge pull request #8 from Aneduna/master
Hardell Jul 20, 2016
cf75c05
Settings/config descriptions
Hardell Jul 21, 2016
889a2f4
Update README.md
Hardell Jul 21, 2016
26d29b1
Use better balls only on stronger CP pokemon. If low CP pokemon and o…
cvax Jul 21, 2016
7466145
Fix bug with using balls better than Great Ball
cvax Jul 21, 2016
9e46b8f
Update README.md
Hardell Jul 21, 2016
57b0504
Printing refresh token to console
Hardell Jul 21, 2016
2c6a786
updated version number
Hardell Jul 21, 2016
11177e0
Restarting after a crash.
Hardell Jul 21, 2016
40687ec
Periodic transf&evolv, Ptc login crash check
Hardell Jul 21, 2016
257512b
accidental writeline
Hardell Jul 21, 2016
88f7b3d
Reduced grinding spam
Hardell Jul 21, 2016
92c4a7e
Merge pull request #12 from cvax/betterBallMgmt
Hardell Jul 21, 2016
1c3e180
Updated version number
Hardell Jul 21, 2016
618683e
Evolve before transfer
Hardell Jul 21, 2016
0408abf
Version number god dammit
Hardell Jul 21, 2016
41ad535
Removed all useless grinding messages
Hardell Jul 21, 2016
9f96d21
Version number dammit
Hardell Jul 21, 2016
f87435e
Now shows what ball was used.
Hardell Jul 21, 2016
4053a76
Rough fix to prevent getting stuck in shitty areas
Hardell Jul 21, 2016
14fa8d2
version number
Hardell Jul 21, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/Pokemon Go Rocket API/v14/.suo
Binary file not shown.
359 changes: 175 additions & 184 deletions PokemonGo/RocketAPI/Client.cs

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion PokemonGo/RocketAPI/Console/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<appSettings>
<add key="AuthType" value="Google"/><!--Google/Ptc-->
<add key="PtcUsername" value="username"/>
<add key="PtcPassword" value="pw"/>
<add key="GoogleRefreshToken" value=""/>
<add key="DefaultLatitude" value="52.379189"/><!--Default Amsterdam Central Station-->
<add key="DefaultLongitude" value="4.899431"/><!--Default Amsterdam Central Station-->
<add key="TransferType" value="none"/><!--none/cp/leaveStrongest/duplicate/all Whitelists/blackslists for each type is in Program.cs-->
<add key="TransferCPThreshold" value="0"/><!--transfer pokemon with CP less than this value if cp transfer type is selected. Whitelist in Program.cs-->
<add key="EvolveAllGivenPokemons" value="false"/>
</appSettings>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand All @@ -47,9 +49,11 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PokemonGo.RocketAPI.csproj">
Expand Down
475 changes: 435 additions & 40 deletions PokemonGo/RocketAPI/Console/Program.cs

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System.Reflection;
using System.Runtime.CompilerServices;
#region

using System.Reflection;
using System.Runtime.InteropServices;

#endregion

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("PokemonGoRocketAPI.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +21,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("1fea147e-f704-497b-a538-00b053b5f672")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +38,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: AssemblyVersion("1.2.10.0")]
[assembly: AssemblyFileVersion("1.2.10.0")]
54 changes: 54 additions & 0 deletions PokemonGo/RocketAPI/Console/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#region

using System.Configuration;
using System.Globalization;
using System.Runtime.CompilerServices;
using PokemonGo.RocketAPI.Enums;

#endregion

namespace PokemonGo.RocketAPI.Console
{
public class Settings : ISettings
{
/// <summary>
/// Don't touch. User settings are in Console/App.config
/// </summary>
public string TransferType => GetSetting() != string.Empty ? GetSetting() : "none";
public int TransferCPThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
public bool EvolveAllGivenPokemons => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;


public AuthType AuthType => (GetSetting() != string.Empty ? GetSetting() : "Ptc") == "Ptc" ? AuthType.Ptc : AuthType.Google;
public string PtcUsername => GetSetting() != string.Empty ? GetSetting() : "username";
public string PtcPassword => GetSetting() != string.Empty ? GetSetting() : "password";

public double DefaultLatitude => GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 51.22640;

//Default Amsterdam Central Station if another location is not specified
public double DefaultLongitude => GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 6.77874;

//Default Amsterdam Central Station if another location is not specified

// LEAVE EVERYTHING ALONE


public string GoogleRefreshToken
{
get { return GetSetting() != string.Empty ? GetSetting() : string.Empty; }
set { SetSetting(value); }
}

private string GetSetting([CallerMemberName] string key = null)
{
return ConfigurationManager.AppSettings[key];
}

private void SetSetting(string value, [CallerMemberName] string key = null)
{
var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (key != null) configFile.AppSettings.Settings[key].Value = value;
configFile.Save();
}
}
}
4 changes: 4 additions & 0 deletions PokemonGo/RocketAPI/Console/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
</packages>
10 changes: 2 additions & 8 deletions PokemonGo/RocketAPI/Enums/AuthType.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PokemonGo.RocketAPI.Enums
namespace PokemonGo.RocketAPI.Enums
{
public enum AuthType
{
Google,
Ptc
}
}
}
10 changes: 2 additions & 8 deletions PokemonGo/RocketAPI/Enums/MiscEnums.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PokemonGo.RocketAPI.GeneratedCode
namespace PokemonGo.RocketAPI.GeneratedCode
{
public class MiscEnums
{
public enum FortType
public enum FortType
{
GYM = 0,
CHECKPOINT = 1
Expand Down
12 changes: 3 additions & 9 deletions PokemonGo/RocketAPI/Enums/RequestType.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PokemonGo.RocketAPI.Enums
namespace PokemonGo.RocketAPI.Enums
{
public enum RequestType
{
Expand Down Expand Up @@ -78,6 +72,6 @@ public enum RequestType
SFIDA_UPDATE = 803,
SFIDA_ACTION = 804,
SFIDA_DOWSER = 805,
SFIDA_CAPTURE = 806,
SFIDA_CAPTURE = 806
}
}
}
12 changes: 12 additions & 0 deletions PokemonGo/RocketAPI/Exceptions/PTCOfflineException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#region

using System;

#endregion

namespace PokemonGo.RocketAPI.Exceptions
{
public class PtcOfflineException : Exception
{
}
}
12 changes: 6 additions & 6 deletions PokemonGo/RocketAPI/Extensions/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#region

using System;

#endregion

namespace PokemonGo.RocketAPI.Extensions
{
Expand All @@ -14,4 +14,4 @@ public static long ToUnixTime(this DateTime date)
return Convert.ToInt64((date - epoch).TotalMilliseconds);
}
}
}
}
36 changes: 26 additions & 10 deletions PokemonGo/RocketAPI/Extensions/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
#region

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Google.Protobuf;
using PokemonGo.RocketAPI;
using PokemonGo.RocketAPI.GeneratedCode;

#endregion

namespace PokemonGo.RocketAPI.Extensions
{
public static class HttpClientExtensions
{
public static async Task<V> PostProto<T, V>(this HttpClient client, string url, T request) where T : IMessage<T> where V : IMessage<V>, new()
public static async Task<Response> PostProto<TRequest>(this HttpClient client, string url, TRequest request)
where TRequest : IMessage<TRequest>
{
//Encode message and send
//Encode payload and put in envelop, then send
var data = request.ToByteString();
var result = await client.PostAsync(url, new ByteArrayContent(data.ToByteArray()));

//Decode message
var responseData = await result.Content.ReadAsByteArrayAsync();
var codedStream = new CodedInputStream(responseData);
var decodedResponse = new V();
var decodedResponse = new Response();
decodedResponse.MergeFrom(codedStream);

return decodedResponse;
}

public static async Task<TResponsePayload> PostProtoPayload<TRequest, TResponsePayload>(this HttpClient client,
string url, TRequest request) where TRequest : IMessage<TRequest>
where TResponsePayload : IMessage<TResponsePayload>, new()
{
//Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")} requesting {typeof(TResponsePayload).Name}");
var response = await PostProto(client, url, request);

//Decode payload
//todo: multi-payload support
var payload = response.Payload[0];
var parsedPayload = new TResponsePayload();
parsedPayload.MergeFrom(payload);

return parsedPayload;
}
}
}
}
Loading