├── .gitattributes ├── .gitignore ├── Pokemon Go Rocket API.sln ├── PokemonGo └── RocketAPI │ ├── Client.cs │ ├── Console │ ├── App.config │ ├── PokemonGo.RocketAPI.Console.csproj │ ├── Program.cs │ └── Properties │ │ └── AssemblyInfo.cs │ ├── Enums │ ├── AuthType.cs │ ├── MiscEnums.cs │ └── RequestType.cs │ ├── Extensions │ ├── DateTimeExtensions.cs │ └── HttpClientExtensions.cs │ ├── GeneratedCode │ ├── CatchPokemonResponse.cs │ ├── EncounterResponse.cs │ ├── FortDetailResponse.cs │ ├── FortSearchResponse.cs │ ├── InventoryResponse.cs │ ├── MapObjectsResponse.cs │ ├── PlayerUpdateResponse.cs │ ├── ProfileResponse.cs │ ├── Request.cs │ └── SettingsResponse.cs │ ├── Helpers │ ├── JsonHelper.cs │ ├── ProtoHelper.cs │ ├── RandomHelper.cs │ ├── RequestBuilder.cs │ ├── RetryHandler.cs │ ├── S2Helper.cs │ └── Utils.cs │ ├── PokemonGo.RocketAPI.csproj │ ├── Properties │ └── AssemblyInfo.cs │ ├── Proto │ ├── CatchPokemonResponse.proto │ ├── EncounterResponse.proto │ ├── FortDetailResponse.proto │ ├── FortSearchResponse.proto │ ├── InventoryResponse.proto │ ├── MapObjectsResponse.proto │ ├── PlayerUpdateResponse.proto │ ├── ProfileResponse.proto │ ├── Request.proto │ └── SettingsResponse.proto │ ├── Resources.cs │ ├── Settings.cs │ ├── app.config │ └── packages.config └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | packages 6 | bin/ 7 | obj/ 8 | /PokemonGo/RocketAPI/Proto/google/protobuf 9 | -------------------------------------------------------------------------------- /Pokemon Go Rocket API.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI", "PokemonGo\RocketAPI\PokemonGo.RocketAPI.csproj", "{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI.Console", "PokemonGo\RocketAPI\Console\PokemonGo.RocketAPI.Console.csproj", "{1FEA147E-F704-497B-A538-00B053B5F672}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {1FEA147E-F704-497B-A538-00B053B5F672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {1FEA147E-F704-497B-A538-00B053B5F672}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {1FEA147E-F704-497B-A538-00B053B5F672}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {1FEA147E-F704-497B-A538-00B053B5F672}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Client.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO.Compression; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.Http; 7 | using System.Net.Http.Formatting; 8 | using System.Net.Http.Headers; 9 | using System.Runtime.InteropServices; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | using System.Web; 13 | using System.Windows.Forms; 14 | using Google.Protobuf; 15 | using Google.Protobuf.Collections; 16 | using Newtonsoft.Json; 17 | using Newtonsoft.Json.Linq; 18 | using PokemonGo.RocketAPI.Enums; 19 | using PokemonGo.RocketAPI.GeneratedCode; 20 | using PokemonGo.RocketAPI.Helpers; 21 | using PokemonGo.RocketAPI.Extensions; 22 | 23 | namespace PokemonGo.RocketAPI 24 | { 25 | public class Client 26 | { 27 | private readonly HttpClient _httpClient; 28 | private AuthType _authType = AuthType.Google; 29 | private string _accessToken; 30 | private string _apiUrl; 31 | private Request.Types.UnknownAuth _unknownAuth; 32 | 33 | private double _currentLat; 34 | private double _currentLng; 35 | 36 | public Client(double lat, double lng) 37 | { 38 | SetCoordinates(lat, lng); 39 | 40 | //Setup HttpClient and create default headers 41 | HttpClientHandler handler = new HttpClientHandler() 42 | { 43 | AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, 44 | AllowAutoRedirect = false 45 | }; 46 | _httpClient = new HttpClient(new RetryHandler(handler)); 47 | _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Niantic App"); 48 | //"Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-G900F Build/LMY48G)"); 49 | _httpClient.DefaultRequestHeaders.ExpectContinue = false; 50 | _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Connection", "keep-alive"); 51 | _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Accept", "*/*"); 52 | _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", 53 | "application/x-www-form-urlencoded"); 54 | } 55 | 56 | private void SetCoordinates(double lat, double lng) 57 | { 58 | _currentLat = lat; 59 | _currentLng = lng; 60 | } 61 | 62 | public async Task LoginGoogle(string deviceId, string email, string refreshToken) 63 | { 64 | var handler = new HttpClientHandler() 65 | { 66 | AutomaticDecompression = DecompressionMethods.GZip, 67 | AllowAutoRedirect = false 68 | }; 69 | 70 | using (var tempHttpClient = new HttpClient(handler)) 71 | { 72 | tempHttpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", 73 | "GoogleAuth/1.4 (kltexx LMY48G); gzip"); 74 | tempHttpClient.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); 75 | tempHttpClient.DefaultRequestHeaders.Add("device", deviceId); 76 | tempHttpClient.DefaultRequestHeaders.Add("app", "com.nianticlabs.pokemongo"); 77 | 78 | var response = await tempHttpClient.PostAsync(Resources.GoogleGrantRefreshAccessUrl, 79 | new FormUrlEncodedContent( 80 | new[] 81 | { 82 | new KeyValuePair("androidId", deviceId), 83 | new KeyValuePair("lang", "nl_NL"), 84 | new KeyValuePair("google_play_services_version", "9256238"), 85 | new KeyValuePair("sdk_version", "22"), 86 | new KeyValuePair("device_country", "nl"), 87 | new KeyValuePair("client_sig", Settings.ClientSig), 88 | new KeyValuePair("caller_sig", Settings.ClientSig), 89 | new KeyValuePair("Email", email), 90 | new KeyValuePair("service", 91 | "audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com"), 92 | new KeyValuePair("app", "com.nianticlabs.pokemongo"), 93 | new KeyValuePair("check_email", "1"), 94 | new KeyValuePair("token_request_options", ""), 95 | new KeyValuePair("callerPkg", "com.nianticlabs.pokemongo"), 96 | new KeyValuePair("Token", refreshToken) 97 | })); 98 | 99 | var content = await response.Content.ReadAsStringAsync(); 100 | _accessToken = content.Split(new[] {"Auth=", "issueAdvice"}, StringSplitOptions.RemoveEmptyEntries)[0]; 101 | _authType = AuthType.Google; 102 | } 103 | } 104 | 105 | public async Task LoginPtc(string username, string password) 106 | { 107 | //Get session cookie 108 | var sessionResp = await _httpClient.GetAsync(Resources.PtcLoginUrl); 109 | var data = await sessionResp.Content.ReadAsStringAsync(); 110 | var lt = JsonHelper.GetValue(data, "lt"); 111 | var executionId = JsonHelper.GetValue(data, "execution"); 112 | 113 | //Login 114 | var loginResp = await _httpClient.PostAsync(Resources.PtcLoginUrl, 115 | new FormUrlEncodedContent( 116 | new[] 117 | { 118 | new KeyValuePair("lt", lt), 119 | new KeyValuePair("execution", executionId), 120 | new KeyValuePair("_eventId", "submit"), 121 | new KeyValuePair("username", username), 122 | new KeyValuePair("password", password), 123 | })); 124 | 125 | var ticketId = HttpUtility.ParseQueryString(loginResp.Headers.Location.Query)["ticket"]; 126 | 127 | //Get tokenvar 128 | var tokenResp = await _httpClient.PostAsync(Resources.PtcLoginOauth, 129 | new FormUrlEncodedContent( 130 | new[] 131 | { 132 | new KeyValuePair("client_id", "mobile-app_pokemon-go"), 133 | new KeyValuePair("redirect_uri", "https://www.nianticlabs.com/pokemongo/error"), 134 | new KeyValuePair("client_secret", 135 | "w8ScCUXJQc6kXKw8FiOhd8Fixzht18Dq3PEVkUCP5ZPxtgyWsbTvWHFLm2wNY0JR"), 136 | new KeyValuePair("grant_type", "grant_type"), 137 | new KeyValuePair("code", ticketId), 138 | })); 139 | 140 | var tokenData = await tokenResp.Content.ReadAsStringAsync(); 141 | _accessToken = HttpUtility.ParseQueryString(tokenData)["access_token"]; 142 | _authType = AuthType.Ptc; 143 | } 144 | 145 | public async Task UpdatePlayerLocation(double lat, double lng) 146 | { 147 | this.SetCoordinates(lat, lng); 148 | var customRequest = new Request.Types.PlayerUpdateProto() 149 | { 150 | Lat = Utils.FloatAsUlong(_currentLat), 151 | Lng = Utils.FloatAsUlong(_currentLng) 152 | }; 153 | 154 | var updateRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10, 155 | new Request.Types.Requests() 156 | { 157 | Type = (int) RequestType.PLAYER_UPDATE, 158 | Message = customRequest.ToByteString() 159 | }); 160 | var updateResponse = 161 | await _httpClient.PostProto($"https://{_apiUrl}/rpc", updateRequest); 162 | return updateResponse; 163 | } 164 | 165 | public async Task GetServer() 166 | { 167 | var serverRequest = RequestBuilder.GetInitialRequest(_accessToken, _authType, _currentLat, _currentLng, 10, 168 | RequestType.GET_PLAYER, RequestType.GET_HATCHED_OBJECTS, RequestType.GET_INVENTORY, 169 | RequestType.CHECK_AWARDED_BADGES, RequestType.DOWNLOAD_SETTINGS); 170 | var serverResponse = await _httpClient.PostProto(Resources.RpcUrl, serverRequest); 171 | _apiUrl = serverResponse.ApiUrl; 172 | return serverResponse; 173 | } 174 | 175 | public async Task GetProfile() 176 | { 177 | var profileRequest = RequestBuilder.GetInitialRequest(_accessToken, _authType, _currentLat, _currentLng, 10, 178 | new Request.Types.Requests() {Type = (int) RequestType.GET_PLAYER}); 179 | var profileResponse = 180 | await _httpClient.PostProto($"https://{_apiUrl}/rpc", profileRequest); 181 | _unknownAuth = new Request.Types.UnknownAuth() 182 | { 183 | Unknown71 = profileResponse.Auth.Unknown71, 184 | Timestamp = profileResponse.Auth.Timestamp, 185 | Unknown73 = profileResponse.Auth.Unknown73, 186 | }; 187 | return profileResponse; 188 | } 189 | 190 | public async Task GetSettings() 191 | { 192 | var settingsRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10, 193 | RequestType.DOWNLOAD_SETTINGS); 194 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", settingsRequest); 195 | } 196 | 197 | public async Task GetMapObjects() 198 | { 199 | var customRequest = new Request.Types.MapObjectsRequest() 200 | { 201 | CellIds = 202 | ByteString.CopyFrom( 203 | ProtoHelper.EncodeUlongList(S2Helper.GetNearbyCellIds(_currentLng, 204 | _currentLat))), 205 | Latitude = Utils.FloatAsUlong(_currentLat), 206 | Longitude = Utils.FloatAsUlong(_currentLng), 207 | Unknown14 = ByteString.CopyFromUtf8("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") 208 | }; 209 | 210 | var mapRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10, 211 | new Request.Types.Requests() 212 | { 213 | Type = (int) RequestType.GET_MAP_OBJECTS, 214 | Message = customRequest.ToByteString() 215 | }, 216 | new Request.Types.Requests() {Type = (int) RequestType.GET_HATCHED_OBJECTS}, 217 | new Request.Types.Requests() 218 | { 219 | Type = (int) RequestType.GET_INVENTORY, 220 | Message = new Request.Types.Time() {Time_ = DateTime.UtcNow.ToUnixTime()}.ToByteString() 221 | }, 222 | new Request.Types.Requests() {Type = (int) RequestType.CHECK_AWARDED_BADGES}, 223 | new Request.Types.Requests() 224 | { 225 | Type = (int) RequestType.DOWNLOAD_SETTINGS, 226 | Message = 227 | new Request.Types.SettingsGuid() 228 | { 229 | Guid = ByteString.CopyFromUtf8("4a2e9bc330dae60e7b74fc85b98868ab4700802e") 230 | }.ToByteString() 231 | }); 232 | 233 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", mapRequest); 234 | } 235 | 236 | public async Task GetFort(string fortId, double fortLat, double fortLng) 237 | { 238 | var customRequest = new Request.Types.FortDetailsRequest() 239 | { 240 | Id = ByteString.CopyFromUtf8(fortId), 241 | Latitude = Utils.FloatAsUlong(fortLat), 242 | Longitude = Utils.FloatAsUlong(fortLng), 243 | }; 244 | 245 | var fortDetailRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10, 246 | new Request.Types.Requests() 247 | { 248 | Type = (int) RequestType.FORT_DETAILS, 249 | Message = customRequest.ToByteString() 250 | }); 251 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", fortDetailRequest); 252 | } 253 | 254 | /*num Holoholo.Rpc.Types.FortSearchOutProto.Result { 255 | NO_RESULT_SET = 0; 256 | SUCCESS = 1; 257 | OUT_OF_RANGE = 2; 258 | IN_COOLDOWN_PERIOD = 3; 259 | INVENTORY_FULL = 4; 260 | }*/ 261 | 262 | public async Task SearchFort(string fortId, double fortLat, double fortLng) 263 | { 264 | var customRequest = new Request.Types.FortSearchRequest() 265 | { 266 | Id = ByteString.CopyFromUtf8(fortId), 267 | FortLatDegrees = Utils.FloatAsUlong(fortLat), 268 | FortLngDegrees = Utils.FloatAsUlong(fortLng), 269 | PlayerLatDegrees = Utils.FloatAsUlong(_currentLat), 270 | PlayerLngDegrees = Utils.FloatAsUlong(_currentLng) 271 | }; 272 | 273 | var fortDetailRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30, 274 | new Request.Types.Requests() 275 | { 276 | Type = (int) RequestType.FORT_SEARCH, 277 | Message = customRequest.ToByteString() 278 | }); 279 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", fortDetailRequest); 280 | } 281 | 282 | public async Task EncounterPokemon(ulong encounterId, string spawnPointGuid) 283 | { 284 | var customRequest = new Request.Types.EncounterRequest() 285 | { 286 | EncounterId = encounterId, 287 | SpawnpointId = spawnPointGuid, 288 | PlayerLatDegrees = Utils.FloatAsUlong(_currentLat), 289 | PlayerLngDegrees = Utils.FloatAsUlong(_currentLng) 290 | }; 291 | 292 | var encounterResponse = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30, 293 | new Request.Types.Requests() 294 | { 295 | Type = (int) RequestType.ENCOUNTER, 296 | Message = customRequest.ToByteString() 297 | }); 298 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", encounterResponse); 299 | } 300 | 301 | public async Task CatchPokemon(ulong encounterId, string spawnPointGuid, double pokemonLat, 302 | double pokemonLng) 303 | { 304 | var customRequest = new Request.Types.CatchPokemonRequest() 305 | { 306 | EncounterId = encounterId, 307 | Pokeball = (int) MiscEnums.Item.ITEM_POKE_BALL, 308 | SpawnPointGuid = spawnPointGuid, 309 | HitPokemon = 1, 310 | NormalizedReticleSize = Utils.FloatAsUlong(1.86440348625), 311 | SpinModifier = Utils.FloatAsUlong(0.00655560661107) 312 | }; 313 | 314 | var catchPokemonRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30, 315 | new Request.Types.Requests() 316 | { 317 | Type = (int) RequestType.CATCH_POKEMON, 318 | Message = customRequest.ToByteString() 319 | }); 320 | return 321 | await 322 | _httpClient.PostProto($"https://{_apiUrl}/rpc", catchPokemonRequest); 323 | } 324 | 325 | 326 | public async Task GetInventory() 327 | { 328 | var inventoryRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30, RequestType.GET_INVENTORY); 329 | return await _httpClient.PostProto($"https://{_apiUrl}/rpc", inventoryRequest); 330 | } 331 | } 332 | } 333 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Console/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Console/PokemonGo.RocketAPI.Console.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1FEA147E-F704-497B-A538-00B053B5F672} 8 | Exe 9 | Properties 10 | PokemonGo.RocketAPI.Console 11 | PokemonGo.RocketAPI.Console 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095} 57 | PokemonGo.RocketAPI 58 | 59 | 60 | 61 | 68 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Console/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Google.Protobuf; 8 | using PokemonGo.RocketAPI.Enums; 9 | using PokemonGo.RocketAPI.Extensions; 10 | using PokemonGo.RocketAPI.GeneratedCode; 11 | using PokemonGo.RocketAPI.Helpers; 12 | 13 | namespace PokemonGo.RocketAPI.Console 14 | { 15 | class Program 16 | { 17 | static void Main(string[] args) 18 | { 19 | Task.Run(() => Execute()); 20 | System.Console.ReadLine(); 21 | } 22 | 23 | static async void Execute() 24 | { 25 | var client = new Client(Settings.DefaultLatitude, Settings.DefaultLongitude); 26 | 27 | //await client.LoginPtc("FeroxRev", "Sekret"); 28 | await client.LoginGoogle(Settings.DeviceId, Settings.Email, Settings.LongDurationToken); 29 | var serverResponse = await client.GetServer(); 30 | var profile = await client.GetProfile(); 31 | var settings = await client.GetSettings(); 32 | var mapObjects = await client.GetMapObjects(); 33 | var inventory = await client.GetInventory(); 34 | await ExecuteFarmingPokestops(client); 35 | await ExecuteCatchAllNearbyPokemons(client); 36 | } 37 | 38 | private static async Task ExecuteFarmingPokestops(Client client) 39 | { 40 | var mapObjects = await client.GetMapObjects(); 41 | 42 | var pokeStops = mapObjects.Payload[0].Profile.SelectMany(i => i.Fort).Where(i => i.FortType == (int)MiscEnums.FortType.CHECKPOINT && i.CooldownCompleteMs < DateTime.UtcNow.ToUnixTime()); 43 | 44 | foreach (var pokeStop in pokeStops) 45 | { 46 | var update = await client.UpdatePlayerLocation(pokeStop.Latitude, pokeStop.Longitude); 47 | var fortInfo = await client.GetFort(pokeStop.FortId, pokeStop.Latitude, pokeStop.Longitude); 48 | var fortSearch = await client.SearchFort(pokeStop.FortId, pokeStop.Latitude, pokeStop.Longitude); 49 | var bag = fortSearch.Payload[0]; 50 | 51 | System.Console.WriteLine($"Farmed XP: {bag.XpAwarded}, Gems: { bag.GemsAwarded}, Eggs: {bag.EggPokemon} Items: {GetFriendlyItemsString(bag.Items)}"); 52 | await Task.Delay(15000); 53 | } 54 | } 55 | 56 | private static async Task ExecuteCatchAllNearbyPokemons(Client client) 57 | { 58 | var mapObjects = await client.GetMapObjects(); 59 | 60 | var pokemons = mapObjects.Payload[0].Profile.SelectMany(i => i.MapPokemon); 61 | 62 | foreach (var pokemon in pokemons) 63 | { 64 | var update = await client.UpdatePlayerLocation(pokemon.Latitude, pokemon.Longitude); 65 | var encounterPokemonRespone = await client.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnpointId); 66 | var caughtPokemonResponse = await client.CatchPokemon(pokemon.EncounterId, pokemon.SpawnpointId, pokemon.Latitude, pokemon.Longitude); 67 | await Task.Delay(15000); 68 | } 69 | 70 | } 71 | 72 | private static string GetFriendlyItemsString(IEnumerable items) 73 | { 74 | var sb = new StringBuilder(); 75 | foreach(var item in items) 76 | sb.Append($"{item.ItemCount} x {(MiscEnums.Item)item.Item_}, "); 77 | 78 | return sb.ToString(); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PokemonGoRocketAPI.Console")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PokemonGoRocketAPI.Console")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1fea147e-f704-497b-a538-00b053b5f672")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Enums/AuthType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.Enums 8 | { 9 | public enum AuthType 10 | { 11 | Google, 12 | Ptc 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Enums/MiscEnums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.GeneratedCode 8 | { 9 | public class MiscEnums 10 | { 11 | public enum FortType 12 | { 13 | GYM = 0, 14 | CHECKPOINT = 1 15 | } 16 | 17 | public enum Item 18 | { 19 | ITEM_UNKNOWN = 0, 20 | ITEM_POKE_BALL = 1, 21 | ITEM_GREAT_BALL = 2, 22 | ITEM_ULTRA_BALL = 3, 23 | ITEM_MASTER_BALL = 4, 24 | ITEM_POTION = 101, 25 | ITEM_SUPER_POTION = 102, 26 | ITEM_HYPER_POTION = 103, 27 | ITEM_MAX_POTION = 104, 28 | ITEM_REVIVE = 201, 29 | ITEM_MAX_REVIVE = 202, 30 | ITEM_LUCKY_EGG = 301, 31 | ITEM_INCENSE_ORDINARY = 401, 32 | ITEM_INCENSE_SPICY = 402, 33 | ITEM_INCENSE_COOL = 403, 34 | ITEM_INCENSE_FLORAL = 404, 35 | ITEM_TROY_DISK = 501, 36 | ITEM_X_ATTACK = 602, 37 | ITEM_X_DEFENSE = 603, 38 | ITEM_X_MIRACLE = 604, 39 | ITEM_RAZZ_BERRY = 701, 40 | ITEM_BLUK_BERRY = 702, 41 | ITEM_NANAB_BERRY = 703, 42 | ITEM_WEPAR_BERRY = 704, 43 | ITEM_PINAP_BERRY = 705, 44 | ITEM_SPECIAL_CAMERA = 801, 45 | ITEM_INCUBATOR_BASIC_UNLIMITED = 901, 46 | ITEM_INCUBATOR_BASIC = 902, 47 | ITEM_POKEMON_STORAGE_UPGRADE = 1001, 48 | ITEM_ITEM_STORAGE_UPGRADE = 1002 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Enums/RequestType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.Enums 8 | { 9 | public enum RequestType 10 | { 11 | METHOD_UNSET = 0, 12 | PLAYER_UPDATE = 1, 13 | GET_PLAYER = 2, 14 | GET_INVENTORY = 4, 15 | DOWNLOAD_SETTINGS = 5, 16 | DOWNLOAD_ITEM_TEMPLATES = 6, 17 | DOWNLOAD_REMOTE_CONFIG_VERSION = 7, 18 | FORT_SEARCH = 101, 19 | ENCOUNTER = 102, 20 | CATCH_POKEMON = 103, 21 | FORT_DETAILS = 104, 22 | ITEM_USE = 105, 23 | GET_MAP_OBJECTS = 106, 24 | FORT_DEPLOY_POKEMON = 110, 25 | FORT_RECALL_POKEMON = 111, 26 | RELEASE_POKEMON = 112, 27 | USE_ITEM_POTION = 113, 28 | USE_ITEM_CAPTURE = 114, 29 | USE_ITEM_FLEE = 115, 30 | USE_ITEM_REVIVE = 116, 31 | TRADE_SEARCH = 117, 32 | TRADE_OFFER = 118, 33 | TRADE_RESPONSE = 119, 34 | TRADE_RESULT = 120, 35 | GET_PLAYER_PROFILE = 121, 36 | GET_ITEM_PACK = 122, 37 | BUY_ITEM_PACK = 123, 38 | BUY_GEM_PACK = 124, 39 | EVOLVE_POKEMON = 125, 40 | GET_HATCHED_OBJECTS = 126, 41 | ENCOUNTER_TUTORIAL_COMPLETE = 127, 42 | LEVEL_UP_REWARDS = 128, 43 | CHECK_AWARDED_BADGES = 129, 44 | USE_ITEM_GYM = 133, 45 | GET_GYM_DETAILS = 134, 46 | START_GYM_BATTLE = 135, 47 | ATTACK_GYM = 136, 48 | RECYCLE_INVENTORY_ITEM = 137, 49 | COLLECT_DAILY_BONUS = 138, 50 | USE_ITEM_XP_BOOST = 139, 51 | USE_ITEM_EGG_INCUBATOR = 140, 52 | USE_INCENSE = 141, 53 | GET_INCENSE_POKEMON = 142, 54 | INCENSE_ENCOUNTER = 143, 55 | ADD_FORT_MODIFIER = 144, 56 | DISK_ENCOUNTER = 145, 57 | COLLECT_DAILY_DEFENDER_BONUS = 146, 58 | UPGRADE_POKEMON = 147, 59 | SET_FAVORITE_POKEMON = 148, 60 | NICKNAME_POKEMON = 149, 61 | EQUIP_BADGE = 150, 62 | SET_CONTACT_SETTINGS = 151, 63 | GET_ASSET_DIGEST = 300, 64 | GET_DOWNLOAD_URLS = 301, 65 | GET_SUGGESTED_CODENAMES = 401, 66 | CHECK_CODENAME_AVAILABLE = 402, 67 | CLAIM_CODENAME = 403, 68 | SET_AVATAR = 404, 69 | SET_PLAYER_TEAM = 405, 70 | MARK_TUTORIAL_COMPLETE = 406, 71 | LOAD_SPAWN_POINTS = 500, 72 | ECHO = 666, 73 | DEBUG_UPDATE_INVENTORY = 700, 74 | DEBUG_DELETE_PLAYER = 701, 75 | SFIDA_REGISTRATION = 800, 76 | SFIDA_ACTION_LOG = 801, 77 | SFIDA_CERTIFICATION = 802, 78 | SFIDA_UPDATE = 803, 79 | SFIDA_ACTION = 804, 80 | SFIDA_DOWSER = 805, 81 | SFIDA_CAPTURE = 806, 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Extensions/DateTimeExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.Extensions 8 | { 9 | public static class DateTimeExtensions 10 | { 11 | public static long ToUnixTime(this DateTime date) 12 | { 13 | var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); 14 | return Convert.ToInt64((date - epoch).TotalMilliseconds); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Extensions/HttpClientExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Google.Protobuf; 8 | using PokemonGo.RocketAPI; 9 | using PokemonGo.RocketAPI.GeneratedCode; 10 | 11 | namespace PokemonGo.RocketAPI.Extensions 12 | { 13 | public static class HttpClientExtensions 14 | { 15 | public static async Task PostProto(this HttpClient client, string url, T request) where T : IMessage where V : IMessage, new() 16 | { 17 | //Encode message and send 18 | var data = request.ToByteString(); 19 | var result = await client.PostAsync(url, new ByteArrayContent(data.ToByteArray())); 20 | 21 | //Decode message 22 | var responseData = await result.Content.ReadAsByteArrayAsync(); 23 | var codedStream = new CodedInputStream(responseData); 24 | var decodedResponse = new V(); 25 | decodedResponse.MergeFrom(codedStream); 26 | 27 | return decodedResponse; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/GeneratedCode/CatchPokemonResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: CatchPokemonResponse.proto 3 | #pragma warning disable 1591, 0612, 3021 4 | #region Designer generated code 5 | 6 | using pb = global::Google.Protobuf; 7 | using pbc = global::Google.Protobuf.Collections; 8 | using pbr = global::Google.Protobuf.Reflection; 9 | using scg = global::System.Collections.Generic; 10 | namespace PokemonGo.RocketAPI.GeneratedCode { 11 | 12 | /// Holder for reflection information generated from CatchPokemonResponse.proto 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 | public static partial class CatchPokemonResponseReflection { 15 | 16 | #region Descriptor 17 | /// File descriptor for CatchPokemonResponse.proto 18 | public static pbr::FileDescriptor Descriptor { 19 | get { return descriptor; } 20 | } 21 | private static pbr::FileDescriptor descriptor; 22 | 23 | static CatchPokemonResponseReflection() { 24 | byte[] descriptorData = global::System.Convert.FromBase64String( 25 | string.Concat( 26 | "ChpDYXRjaFBva2Vtb25SZXNwb25zZS5wcm90bxIhUG9rZW1vbkdvLlJvY2tl", 27 | "dEFQSS5HZW5lcmF0ZWRDb2RlIpUFChRDYXRjaFBva2Vtb25SZXNwb25zZRIQ", 28 | "Cgh1bmtub3duMRgBIAEoBRIQCgh1bmtub3duMhgCIAEoAxIPCgdhcGlfdXJs", 29 | "GAMgASgJElIKCHVua25vd242GAYgASgLMkAuUG9rZW1vbkdvLlJvY2tldEFQ", 30 | "SS5HZW5lcmF0ZWRDb2RlLkNhdGNoUG9rZW1vblJlc3BvbnNlLlVua25vd242", 31 | "ElIKCHVua25vd243GAcgASgLMkAuUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5l", 32 | "cmF0ZWRDb2RlLkNhdGNoUG9rZW1vblJlc3BvbnNlLlVua25vd243ElAKB3Bh", 33 | "eWxvYWQYZCADKAsyPy5Qb2tlbW9uR28uUm9ja2V0QVBJLkdlbmVyYXRlZENv", 34 | "ZGUuQ2F0Y2hQb2tlbW9uUmVzcG9uc2UuUGF5bG9hZBIUCgxlcnJvck1lc3Nh", 35 | "Z2UYZSABKAkalwEKCFVua25vd242EhAKCHVua25vd24xGAEgASgFElsKCHVu", 36 | "a25vd24yGAIgASgLMkkuUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5lcmF0ZWRD", 37 | "b2RlLkNhdGNoUG9rZW1vblJlc3BvbnNlLlVua25vd242LlVua25vd24yGhwK", 38 | "CFVua25vd24yEhAKCHVua25vd24xGAEgASgMGkMKCFVua25vd243EhEKCXVu", 39 | "a25vd243MRgBIAEoDBIRCgl1bmtub3duNzIYAiABKAMSEQoJdW5rbm93bjcz", 40 | "GAMgASgMGlkKB1BheWxvYWQSDgoGU3RhdHVzGAEgASgFEhMKC01pc3NQZXJj", 41 | "ZW50GAIgASgFEhkKEUNhcHR1cmVkUG9rZW1vbklkGAMgASgFEg4KBlNjb3Jl", 42 | "cxgEIAEoBWIGcHJvdG8z")); 43 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 44 | new pbr::FileDescriptor[] { }, 45 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 46 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse), global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Parser, new[]{ "Unknown1", "Unknown2", "ApiUrl", "Unknown6", "Unknown7", "Payload", "ErrorMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6), global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Parser, new[]{ "Unknown1", "Unknown2" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2), global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2.Parser, new[]{ "Unknown1" }, null, null, null)}), 47 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7), global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7.Parser, new[]{ "Unknown71", "Unknown72", "Unknown73" }, null, null, null), 48 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Payload), global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Payload.Parser, new[]{ "Status", "MissPercent", "CapturedPokemonId", "Scores" }, null, null, null)}) 49 | })); 50 | } 51 | #endregion 52 | 53 | } 54 | #region Messages 55 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 56 | public sealed partial class CatchPokemonResponse : pb::IMessage { 57 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CatchPokemonResponse()); 58 | public static pb::MessageParser Parser { get { return _parser; } } 59 | 60 | public static pbr::MessageDescriptor Descriptor { 61 | get { return global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponseReflection.Descriptor.MessageTypes[0]; } 62 | } 63 | 64 | pbr::MessageDescriptor pb::IMessage.Descriptor { 65 | get { return Descriptor; } 66 | } 67 | 68 | public CatchPokemonResponse() { 69 | OnConstruction(); 70 | } 71 | 72 | partial void OnConstruction(); 73 | 74 | public CatchPokemonResponse(CatchPokemonResponse other) : this() { 75 | unknown1_ = other.unknown1_; 76 | unknown2_ = other.unknown2_; 77 | apiUrl_ = other.apiUrl_; 78 | Unknown6 = other.unknown6_ != null ? other.Unknown6.Clone() : null; 79 | Unknown7 = other.unknown7_ != null ? other.Unknown7.Clone() : null; 80 | payload_ = other.payload_.Clone(); 81 | errorMessage_ = other.errorMessage_; 82 | } 83 | 84 | public CatchPokemonResponse Clone() { 85 | return new CatchPokemonResponse(this); 86 | } 87 | 88 | /// Field number for the "unknown1" field. 89 | public const int Unknown1FieldNumber = 1; 90 | private int unknown1_; 91 | public int Unknown1 { 92 | get { return unknown1_; } 93 | set { 94 | unknown1_ = value; 95 | } 96 | } 97 | 98 | /// Field number for the "unknown2" field. 99 | public const int Unknown2FieldNumber = 2; 100 | private long unknown2_; 101 | public long Unknown2 { 102 | get { return unknown2_; } 103 | set { 104 | unknown2_ = value; 105 | } 106 | } 107 | 108 | /// Field number for the "api_url" field. 109 | public const int ApiUrlFieldNumber = 3; 110 | private string apiUrl_ = ""; 111 | public string ApiUrl { 112 | get { return apiUrl_; } 113 | set { 114 | apiUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 115 | } 116 | } 117 | 118 | /// Field number for the "unknown6" field. 119 | public const int Unknown6FieldNumber = 6; 120 | private global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6 unknown6_; 121 | public global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6 Unknown6 { 122 | get { return unknown6_; } 123 | set { 124 | unknown6_ = value; 125 | } 126 | } 127 | 128 | /// Field number for the "unknown7" field. 129 | public const int Unknown7FieldNumber = 7; 130 | private global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7 unknown7_; 131 | public global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7 Unknown7 { 132 | get { return unknown7_; } 133 | set { 134 | unknown7_ = value; 135 | } 136 | } 137 | 138 | /// Field number for the "payload" field. 139 | public const int PayloadFieldNumber = 100; 140 | private static readonly pb::FieldCodec _repeated_payload_codec 141 | = pb::FieldCodec.ForMessage(802, global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Payload.Parser); 142 | private readonly pbc::RepeatedField payload_ = new pbc::RepeatedField(); 143 | public pbc::RepeatedField Payload { 144 | get { return payload_; } 145 | } 146 | 147 | /// Field number for the "errorMessage" field. 148 | public const int ErrorMessageFieldNumber = 101; 149 | private string errorMessage_ = ""; 150 | /// 151 | /// Should be moved to an error-proto file if error is always 101 field 152 | /// 153 | public string ErrorMessage { 154 | get { return errorMessage_; } 155 | set { 156 | errorMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 157 | } 158 | } 159 | 160 | public override bool Equals(object other) { 161 | return Equals(other as CatchPokemonResponse); 162 | } 163 | 164 | public bool Equals(CatchPokemonResponse other) { 165 | if (ReferenceEquals(other, null)) { 166 | return false; 167 | } 168 | if (ReferenceEquals(other, this)) { 169 | return true; 170 | } 171 | if (Unknown1 != other.Unknown1) return false; 172 | if (Unknown2 != other.Unknown2) return false; 173 | if (ApiUrl != other.ApiUrl) return false; 174 | if (!object.Equals(Unknown6, other.Unknown6)) return false; 175 | if (!object.Equals(Unknown7, other.Unknown7)) return false; 176 | if(!payload_.Equals(other.payload_)) return false; 177 | if (ErrorMessage != other.ErrorMessage) return false; 178 | return true; 179 | } 180 | 181 | public override int GetHashCode() { 182 | int hash = 1; 183 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 184 | if (Unknown2 != 0L) hash ^= Unknown2.GetHashCode(); 185 | if (ApiUrl.Length != 0) hash ^= ApiUrl.GetHashCode(); 186 | if (unknown6_ != null) hash ^= Unknown6.GetHashCode(); 187 | if (unknown7_ != null) hash ^= Unknown7.GetHashCode(); 188 | hash ^= payload_.GetHashCode(); 189 | if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); 190 | return hash; 191 | } 192 | 193 | public override string ToString() { 194 | return pb::JsonFormatter.ToDiagnosticString(this); 195 | } 196 | 197 | public void WriteTo(pb::CodedOutputStream output) { 198 | if (Unknown1 != 0) { 199 | output.WriteRawTag(8); 200 | output.WriteInt32(Unknown1); 201 | } 202 | if (Unknown2 != 0L) { 203 | output.WriteRawTag(16); 204 | output.WriteInt64(Unknown2); 205 | } 206 | if (ApiUrl.Length != 0) { 207 | output.WriteRawTag(26); 208 | output.WriteString(ApiUrl); 209 | } 210 | if (unknown6_ != null) { 211 | output.WriteRawTag(50); 212 | output.WriteMessage(Unknown6); 213 | } 214 | if (unknown7_ != null) { 215 | output.WriteRawTag(58); 216 | output.WriteMessage(Unknown7); 217 | } 218 | payload_.WriteTo(output, _repeated_payload_codec); 219 | if (ErrorMessage.Length != 0) { 220 | output.WriteRawTag(170, 6); 221 | output.WriteString(ErrorMessage); 222 | } 223 | } 224 | 225 | public int CalculateSize() { 226 | int size = 0; 227 | if (Unknown1 != 0) { 228 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 229 | } 230 | if (Unknown2 != 0L) { 231 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown2); 232 | } 233 | if (ApiUrl.Length != 0) { 234 | size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiUrl); 235 | } 236 | if (unknown6_ != null) { 237 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown6); 238 | } 239 | if (unknown7_ != null) { 240 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown7); 241 | } 242 | size += payload_.CalculateSize(_repeated_payload_codec); 243 | if (ErrorMessage.Length != 0) { 244 | size += 2 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); 245 | } 246 | return size; 247 | } 248 | 249 | public void MergeFrom(CatchPokemonResponse other) { 250 | if (other == null) { 251 | return; 252 | } 253 | if (other.Unknown1 != 0) { 254 | Unknown1 = other.Unknown1; 255 | } 256 | if (other.Unknown2 != 0L) { 257 | Unknown2 = other.Unknown2; 258 | } 259 | if (other.ApiUrl.Length != 0) { 260 | ApiUrl = other.ApiUrl; 261 | } 262 | if (other.unknown6_ != null) { 263 | if (unknown6_ == null) { 264 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6(); 265 | } 266 | Unknown6.MergeFrom(other.Unknown6); 267 | } 268 | if (other.unknown7_ != null) { 269 | if (unknown7_ == null) { 270 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7(); 271 | } 272 | Unknown7.MergeFrom(other.Unknown7); 273 | } 274 | payload_.Add(other.payload_); 275 | if (other.ErrorMessage.Length != 0) { 276 | ErrorMessage = other.ErrorMessage; 277 | } 278 | } 279 | 280 | public void MergeFrom(pb::CodedInputStream input) { 281 | uint tag; 282 | while ((tag = input.ReadTag()) != 0) { 283 | switch(tag) { 284 | default: 285 | input.SkipLastField(); 286 | break; 287 | case 8: { 288 | Unknown1 = input.ReadInt32(); 289 | break; 290 | } 291 | case 16: { 292 | Unknown2 = input.ReadInt64(); 293 | break; 294 | } 295 | case 26: { 296 | ApiUrl = input.ReadString(); 297 | break; 298 | } 299 | case 50: { 300 | if (unknown6_ == null) { 301 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6(); 302 | } 303 | input.ReadMessage(unknown6_); 304 | break; 305 | } 306 | case 58: { 307 | if (unknown7_ == null) { 308 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown7(); 309 | } 310 | input.ReadMessage(unknown7_); 311 | break; 312 | } 313 | case 802: { 314 | payload_.AddEntriesFrom(input, _repeated_payload_codec); 315 | break; 316 | } 317 | case 810: { 318 | ErrorMessage = input.ReadString(); 319 | break; 320 | } 321 | } 322 | } 323 | } 324 | 325 | #region Nested types 326 | /// Container for nested types declared in the CatchPokemonResponse message type. 327 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 328 | public static partial class Types { 329 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 330 | public sealed partial class Unknown6 : pb::IMessage { 331 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown6()); 332 | public static pb::MessageParser Parser { get { return _parser; } } 333 | 334 | public static pbr::MessageDescriptor Descriptor { 335 | get { return global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Descriptor.NestedTypes[0]; } 336 | } 337 | 338 | pbr::MessageDescriptor pb::IMessage.Descriptor { 339 | get { return Descriptor; } 340 | } 341 | 342 | public Unknown6() { 343 | OnConstruction(); 344 | } 345 | 346 | partial void OnConstruction(); 347 | 348 | public Unknown6(Unknown6 other) : this() { 349 | unknown1_ = other.unknown1_; 350 | Unknown2 = other.unknown2_ != null ? other.Unknown2.Clone() : null; 351 | } 352 | 353 | public Unknown6 Clone() { 354 | return new Unknown6(this); 355 | } 356 | 357 | /// Field number for the "unknown1" field. 358 | public const int Unknown1FieldNumber = 1; 359 | private int unknown1_; 360 | public int Unknown1 { 361 | get { return unknown1_; } 362 | set { 363 | unknown1_ = value; 364 | } 365 | } 366 | 367 | /// Field number for the "unknown2" field. 368 | public const int Unknown2FieldNumber = 2; 369 | private global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2 unknown2_; 370 | public global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2 Unknown2 { 371 | get { return unknown2_; } 372 | set { 373 | unknown2_ = value; 374 | } 375 | } 376 | 377 | public override bool Equals(object other) { 378 | return Equals(other as Unknown6); 379 | } 380 | 381 | public bool Equals(Unknown6 other) { 382 | if (ReferenceEquals(other, null)) { 383 | return false; 384 | } 385 | if (ReferenceEquals(other, this)) { 386 | return true; 387 | } 388 | if (Unknown1 != other.Unknown1) return false; 389 | if (!object.Equals(Unknown2, other.Unknown2)) return false; 390 | return true; 391 | } 392 | 393 | public override int GetHashCode() { 394 | int hash = 1; 395 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 396 | if (unknown2_ != null) hash ^= Unknown2.GetHashCode(); 397 | return hash; 398 | } 399 | 400 | public override string ToString() { 401 | return pb::JsonFormatter.ToDiagnosticString(this); 402 | } 403 | 404 | public void WriteTo(pb::CodedOutputStream output) { 405 | if (Unknown1 != 0) { 406 | output.WriteRawTag(8); 407 | output.WriteInt32(Unknown1); 408 | } 409 | if (unknown2_ != null) { 410 | output.WriteRawTag(18); 411 | output.WriteMessage(Unknown2); 412 | } 413 | } 414 | 415 | public int CalculateSize() { 416 | int size = 0; 417 | if (Unknown1 != 0) { 418 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 419 | } 420 | if (unknown2_ != null) { 421 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown2); 422 | } 423 | return size; 424 | } 425 | 426 | public void MergeFrom(Unknown6 other) { 427 | if (other == null) { 428 | return; 429 | } 430 | if (other.Unknown1 != 0) { 431 | Unknown1 = other.Unknown1; 432 | } 433 | if (other.unknown2_ != null) { 434 | if (unknown2_ == null) { 435 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2(); 436 | } 437 | Unknown2.MergeFrom(other.Unknown2); 438 | } 439 | } 440 | 441 | public void MergeFrom(pb::CodedInputStream input) { 442 | uint tag; 443 | while ((tag = input.ReadTag()) != 0) { 444 | switch(tag) { 445 | default: 446 | input.SkipLastField(); 447 | break; 448 | case 8: { 449 | Unknown1 = input.ReadInt32(); 450 | break; 451 | } 452 | case 18: { 453 | if (unknown2_ == null) { 454 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Types.Unknown2(); 455 | } 456 | input.ReadMessage(unknown2_); 457 | break; 458 | } 459 | } 460 | } 461 | } 462 | 463 | #region Nested types 464 | /// Container for nested types declared in the Unknown6 message type. 465 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 466 | public static partial class Types { 467 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 468 | public sealed partial class Unknown2 : pb::IMessage { 469 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown2()); 470 | public static pb::MessageParser Parser { get { return _parser; } } 471 | 472 | public static pbr::MessageDescriptor Descriptor { 473 | get { return global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Types.Unknown6.Descriptor.NestedTypes[0]; } 474 | } 475 | 476 | pbr::MessageDescriptor pb::IMessage.Descriptor { 477 | get { return Descriptor; } 478 | } 479 | 480 | public Unknown2() { 481 | OnConstruction(); 482 | } 483 | 484 | partial void OnConstruction(); 485 | 486 | public Unknown2(Unknown2 other) : this() { 487 | unknown1_ = other.unknown1_; 488 | } 489 | 490 | public Unknown2 Clone() { 491 | return new Unknown2(this); 492 | } 493 | 494 | /// Field number for the "unknown1" field. 495 | public const int Unknown1FieldNumber = 1; 496 | private pb::ByteString unknown1_ = pb::ByteString.Empty; 497 | public pb::ByteString Unknown1 { 498 | get { return unknown1_; } 499 | set { 500 | unknown1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 501 | } 502 | } 503 | 504 | public override bool Equals(object other) { 505 | return Equals(other as Unknown2); 506 | } 507 | 508 | public bool Equals(Unknown2 other) { 509 | if (ReferenceEquals(other, null)) { 510 | return false; 511 | } 512 | if (ReferenceEquals(other, this)) { 513 | return true; 514 | } 515 | if (Unknown1 != other.Unknown1) return false; 516 | return true; 517 | } 518 | 519 | public override int GetHashCode() { 520 | int hash = 1; 521 | if (Unknown1.Length != 0) hash ^= Unknown1.GetHashCode(); 522 | return hash; 523 | } 524 | 525 | public override string ToString() { 526 | return pb::JsonFormatter.ToDiagnosticString(this); 527 | } 528 | 529 | public void WriteTo(pb::CodedOutputStream output) { 530 | if (Unknown1.Length != 0) { 531 | output.WriteRawTag(10); 532 | output.WriteBytes(Unknown1); 533 | } 534 | } 535 | 536 | public int CalculateSize() { 537 | int size = 0; 538 | if (Unknown1.Length != 0) { 539 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown1); 540 | } 541 | return size; 542 | } 543 | 544 | public void MergeFrom(Unknown2 other) { 545 | if (other == null) { 546 | return; 547 | } 548 | if (other.Unknown1.Length != 0) { 549 | Unknown1 = other.Unknown1; 550 | } 551 | } 552 | 553 | public void MergeFrom(pb::CodedInputStream input) { 554 | uint tag; 555 | while ((tag = input.ReadTag()) != 0) { 556 | switch(tag) { 557 | default: 558 | input.SkipLastField(); 559 | break; 560 | case 10: { 561 | Unknown1 = input.ReadBytes(); 562 | break; 563 | } 564 | } 565 | } 566 | } 567 | 568 | } 569 | 570 | } 571 | #endregion 572 | 573 | } 574 | 575 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 576 | public sealed partial class Unknown7 : pb::IMessage { 577 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown7()); 578 | public static pb::MessageParser Parser { get { return _parser; } } 579 | 580 | public static pbr::MessageDescriptor Descriptor { 581 | get { return global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Descriptor.NestedTypes[1]; } 582 | } 583 | 584 | pbr::MessageDescriptor pb::IMessage.Descriptor { 585 | get { return Descriptor; } 586 | } 587 | 588 | public Unknown7() { 589 | OnConstruction(); 590 | } 591 | 592 | partial void OnConstruction(); 593 | 594 | public Unknown7(Unknown7 other) : this() { 595 | unknown71_ = other.unknown71_; 596 | unknown72_ = other.unknown72_; 597 | unknown73_ = other.unknown73_; 598 | } 599 | 600 | public Unknown7 Clone() { 601 | return new Unknown7(this); 602 | } 603 | 604 | /// Field number for the "unknown71" field. 605 | public const int Unknown71FieldNumber = 1; 606 | private pb::ByteString unknown71_ = pb::ByteString.Empty; 607 | public pb::ByteString Unknown71 { 608 | get { return unknown71_; } 609 | set { 610 | unknown71_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 611 | } 612 | } 613 | 614 | /// Field number for the "unknown72" field. 615 | public const int Unknown72FieldNumber = 2; 616 | private long unknown72_; 617 | public long Unknown72 { 618 | get { return unknown72_; } 619 | set { 620 | unknown72_ = value; 621 | } 622 | } 623 | 624 | /// Field number for the "unknown73" field. 625 | public const int Unknown73FieldNumber = 3; 626 | private pb::ByteString unknown73_ = pb::ByteString.Empty; 627 | public pb::ByteString Unknown73 { 628 | get { return unknown73_; } 629 | set { 630 | unknown73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 631 | } 632 | } 633 | 634 | public override bool Equals(object other) { 635 | return Equals(other as Unknown7); 636 | } 637 | 638 | public bool Equals(Unknown7 other) { 639 | if (ReferenceEquals(other, null)) { 640 | return false; 641 | } 642 | if (ReferenceEquals(other, this)) { 643 | return true; 644 | } 645 | if (Unknown71 != other.Unknown71) return false; 646 | if (Unknown72 != other.Unknown72) return false; 647 | if (Unknown73 != other.Unknown73) return false; 648 | return true; 649 | } 650 | 651 | public override int GetHashCode() { 652 | int hash = 1; 653 | if (Unknown71.Length != 0) hash ^= Unknown71.GetHashCode(); 654 | if (Unknown72 != 0L) hash ^= Unknown72.GetHashCode(); 655 | if (Unknown73.Length != 0) hash ^= Unknown73.GetHashCode(); 656 | return hash; 657 | } 658 | 659 | public override string ToString() { 660 | return pb::JsonFormatter.ToDiagnosticString(this); 661 | } 662 | 663 | public void WriteTo(pb::CodedOutputStream output) { 664 | if (Unknown71.Length != 0) { 665 | output.WriteRawTag(10); 666 | output.WriteBytes(Unknown71); 667 | } 668 | if (Unknown72 != 0L) { 669 | output.WriteRawTag(16); 670 | output.WriteInt64(Unknown72); 671 | } 672 | if (Unknown73.Length != 0) { 673 | output.WriteRawTag(26); 674 | output.WriteBytes(Unknown73); 675 | } 676 | } 677 | 678 | public int CalculateSize() { 679 | int size = 0; 680 | if (Unknown71.Length != 0) { 681 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown71); 682 | } 683 | if (Unknown72 != 0L) { 684 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown72); 685 | } 686 | if (Unknown73.Length != 0) { 687 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown73); 688 | } 689 | return size; 690 | } 691 | 692 | public void MergeFrom(Unknown7 other) { 693 | if (other == null) { 694 | return; 695 | } 696 | if (other.Unknown71.Length != 0) { 697 | Unknown71 = other.Unknown71; 698 | } 699 | if (other.Unknown72 != 0L) { 700 | Unknown72 = other.Unknown72; 701 | } 702 | if (other.Unknown73.Length != 0) { 703 | Unknown73 = other.Unknown73; 704 | } 705 | } 706 | 707 | public void MergeFrom(pb::CodedInputStream input) { 708 | uint tag; 709 | while ((tag = input.ReadTag()) != 0) { 710 | switch(tag) { 711 | default: 712 | input.SkipLastField(); 713 | break; 714 | case 10: { 715 | Unknown71 = input.ReadBytes(); 716 | break; 717 | } 718 | case 16: { 719 | Unknown72 = input.ReadInt64(); 720 | break; 721 | } 722 | case 26: { 723 | Unknown73 = input.ReadBytes(); 724 | break; 725 | } 726 | } 727 | } 728 | } 729 | 730 | } 731 | 732 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 733 | public sealed partial class Payload : pb::IMessage { 734 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); 735 | public static pb::MessageParser Parser { get { return _parser; } } 736 | 737 | public static pbr::MessageDescriptor Descriptor { 738 | get { return global::PokemonGo.RocketAPI.GeneratedCode.CatchPokemonResponse.Descriptor.NestedTypes[2]; } 739 | } 740 | 741 | pbr::MessageDescriptor pb::IMessage.Descriptor { 742 | get { return Descriptor; } 743 | } 744 | 745 | public Payload() { 746 | OnConstruction(); 747 | } 748 | 749 | partial void OnConstruction(); 750 | 751 | public Payload(Payload other) : this() { 752 | status_ = other.status_; 753 | missPercent_ = other.missPercent_; 754 | capturedPokemonId_ = other.capturedPokemonId_; 755 | scores_ = other.scores_; 756 | } 757 | 758 | public Payload Clone() { 759 | return new Payload(this); 760 | } 761 | 762 | /// Field number for the "Status" field. 763 | public const int StatusFieldNumber = 1; 764 | private int status_; 765 | public int Status { 766 | get { return status_; } 767 | set { 768 | status_ = value; 769 | } 770 | } 771 | 772 | /// Field number for the "MissPercent" field. 773 | public const int MissPercentFieldNumber = 2; 774 | private int missPercent_; 775 | public int MissPercent { 776 | get { return missPercent_; } 777 | set { 778 | missPercent_ = value; 779 | } 780 | } 781 | 782 | /// Field number for the "CapturedPokemonId" field. 783 | public const int CapturedPokemonIdFieldNumber = 3; 784 | private int capturedPokemonId_; 785 | public int CapturedPokemonId { 786 | get { return capturedPokemonId_; } 787 | set { 788 | capturedPokemonId_ = value; 789 | } 790 | } 791 | 792 | /// Field number for the "Scores" field. 793 | public const int ScoresFieldNumber = 4; 794 | private int scores_; 795 | public int Scores { 796 | get { return scores_; } 797 | set { 798 | scores_ = value; 799 | } 800 | } 801 | 802 | public override bool Equals(object other) { 803 | return Equals(other as Payload); 804 | } 805 | 806 | public bool Equals(Payload other) { 807 | if (ReferenceEquals(other, null)) { 808 | return false; 809 | } 810 | if (ReferenceEquals(other, this)) { 811 | return true; 812 | } 813 | if (Status != other.Status) return false; 814 | if (MissPercent != other.MissPercent) return false; 815 | if (CapturedPokemonId != other.CapturedPokemonId) return false; 816 | if (Scores != other.Scores) return false; 817 | return true; 818 | } 819 | 820 | public override int GetHashCode() { 821 | int hash = 1; 822 | if (Status != 0) hash ^= Status.GetHashCode(); 823 | if (MissPercent != 0) hash ^= MissPercent.GetHashCode(); 824 | if (CapturedPokemonId != 0) hash ^= CapturedPokemonId.GetHashCode(); 825 | if (Scores != 0) hash ^= Scores.GetHashCode(); 826 | return hash; 827 | } 828 | 829 | public override string ToString() { 830 | return pb::JsonFormatter.ToDiagnosticString(this); 831 | } 832 | 833 | public void WriteTo(pb::CodedOutputStream output) { 834 | if (Status != 0) { 835 | output.WriteRawTag(8); 836 | output.WriteInt32(Status); 837 | } 838 | if (MissPercent != 0) { 839 | output.WriteRawTag(16); 840 | output.WriteInt32(MissPercent); 841 | } 842 | if (CapturedPokemonId != 0) { 843 | output.WriteRawTag(24); 844 | output.WriteInt32(CapturedPokemonId); 845 | } 846 | if (Scores != 0) { 847 | output.WriteRawTag(32); 848 | output.WriteInt32(Scores); 849 | } 850 | } 851 | 852 | public int CalculateSize() { 853 | int size = 0; 854 | if (Status != 0) { 855 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Status); 856 | } 857 | if (MissPercent != 0) { 858 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(MissPercent); 859 | } 860 | if (CapturedPokemonId != 0) { 861 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(CapturedPokemonId); 862 | } 863 | if (Scores != 0) { 864 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Scores); 865 | } 866 | return size; 867 | } 868 | 869 | public void MergeFrom(Payload other) { 870 | if (other == null) { 871 | return; 872 | } 873 | if (other.Status != 0) { 874 | Status = other.Status; 875 | } 876 | if (other.MissPercent != 0) { 877 | MissPercent = other.MissPercent; 878 | } 879 | if (other.CapturedPokemonId != 0) { 880 | CapturedPokemonId = other.CapturedPokemonId; 881 | } 882 | if (other.Scores != 0) { 883 | Scores = other.Scores; 884 | } 885 | } 886 | 887 | public void MergeFrom(pb::CodedInputStream input) { 888 | uint tag; 889 | while ((tag = input.ReadTag()) != 0) { 890 | switch(tag) { 891 | default: 892 | input.SkipLastField(); 893 | break; 894 | case 8: { 895 | Status = input.ReadInt32(); 896 | break; 897 | } 898 | case 16: { 899 | MissPercent = input.ReadInt32(); 900 | break; 901 | } 902 | case 24: { 903 | CapturedPokemonId = input.ReadInt32(); 904 | break; 905 | } 906 | case 32: { 907 | Scores = input.ReadInt32(); 908 | break; 909 | } 910 | } 911 | } 912 | } 913 | 914 | } 915 | 916 | } 917 | #endregion 918 | 919 | } 920 | 921 | #endregion 922 | 923 | } 924 | 925 | #endregion Designer generated code 926 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/GeneratedCode/EncounterResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: EncounterResponse.proto 3 | #pragma warning disable 1591, 0612, 3021 4 | #region Designer generated code 5 | 6 | using pb = global::Google.Protobuf; 7 | using pbc = global::Google.Protobuf.Collections; 8 | using pbr = global::Google.Protobuf.Reflection; 9 | using scg = global::System.Collections.Generic; 10 | namespace PokemonGo.RocketAPI.GeneratedCode { 11 | 12 | /// Holder for reflection information generated from EncounterResponse.proto 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 | public static partial class EncounterResponseReflection { 15 | 16 | #region Descriptor 17 | /// File descriptor for EncounterResponse.proto 18 | public static pbr::FileDescriptor Descriptor { 19 | get { return descriptor; } 20 | } 21 | private static pbr::FileDescriptor descriptor; 22 | 23 | static EncounterResponseReflection() { 24 | byte[] descriptorData = global::System.Convert.FromBase64String( 25 | string.Concat( 26 | "ChdFbmNvdW50ZXJSZXNwb25zZS5wcm90bxIhUG9rZW1vbkdvLlJvY2tldEFQ", 27 | "SS5HZW5lcmF0ZWRDb2RlIocFChFFbmNvdW50ZXJSZXNwb25zZRIQCgh1bmtu", 28 | "b3duMRgBIAEoBRIQCgh1bmtub3duMhgCIAEoAxIPCgdhcGlfdXJsGAMgASgJ", 29 | "Ek8KCHVua25vd242GAYgASgLMj0uUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5l", 30 | "cmF0ZWRDb2RlLkVuY291bnRlclJlc3BvbnNlLlVua25vd242Ek8KCHVua25v", 31 | "d243GAcgASgLMj0uUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5lcmF0ZWRDb2Rl", 32 | "LkVuY291bnRlclJlc3BvbnNlLlVua25vd243Ek0KB3BheWxvYWQYZCADKAsy", 33 | "PC5Qb2tlbW9uR28uUm9ja2V0QVBJLkdlbmVyYXRlZENvZGUuRW5jb3VudGVy", 34 | "UmVzcG9uc2UuUGF5bG9hZBIUCgxlcnJvck1lc3NhZ2UYZSABKAkalAEKCFVu", 35 | "a25vd242EhAKCHVua25vd24xGAEgASgFElgKCHVua25vd24yGAIgASgLMkYu", 36 | "UG9rZW1vbkdvLlJvY2tldEFQSS5HZW5lcmF0ZWRDb2RlLkVuY291bnRlclJl", 37 | "c3BvbnNlLlVua25vd242LlVua25vd24yGhwKCFVua25vd24yEhAKCHVua25v", 38 | "d24xGAEgASgMGkMKCFVua25vd243EhEKCXVua25vd243MRgBIAEoDBIRCgl1", 39 | "bmtub3duNzIYAiABKAMSEQoJdW5rbm93bjczGAMgASgMGloKB1BheWxvYWQS", 40 | "DwoHUG9rZW1vbhgBIAEoBRISCgpCYWNrZ3JvdW5kGAIgASgFEg4KBlN0YXR1", 41 | "cxgDIAEoBRIaChJDYXB0dXJlUHJvYmFiaWxpdHkYBCABKAViBnByb3RvMw==")); 42 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 43 | new pbr::FileDescriptor[] { }, 44 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 45 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse), global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Parser, new[]{ "Unknown1", "Unknown2", "ApiUrl", "Unknown6", "Unknown7", "Payload", "ErrorMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6), global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Parser, new[]{ "Unknown1", "Unknown2" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2), global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2.Parser, new[]{ "Unknown1" }, null, null, null)}), 46 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7), global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7.Parser, new[]{ "Unknown71", "Unknown72", "Unknown73" }, null, null, null), 47 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Payload), global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Payload.Parser, new[]{ "Pokemon", "Background", "Status", "CaptureProbability" }, null, null, null)}) 48 | })); 49 | } 50 | #endregion 51 | 52 | } 53 | #region Messages 54 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 55 | public sealed partial class EncounterResponse : pb::IMessage { 56 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EncounterResponse()); 57 | public static pb::MessageParser Parser { get { return _parser; } } 58 | 59 | public static pbr::MessageDescriptor Descriptor { 60 | get { return global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponseReflection.Descriptor.MessageTypes[0]; } 61 | } 62 | 63 | pbr::MessageDescriptor pb::IMessage.Descriptor { 64 | get { return Descriptor; } 65 | } 66 | 67 | public EncounterResponse() { 68 | OnConstruction(); 69 | } 70 | 71 | partial void OnConstruction(); 72 | 73 | public EncounterResponse(EncounterResponse other) : this() { 74 | unknown1_ = other.unknown1_; 75 | unknown2_ = other.unknown2_; 76 | apiUrl_ = other.apiUrl_; 77 | Unknown6 = other.unknown6_ != null ? other.Unknown6.Clone() : null; 78 | Unknown7 = other.unknown7_ != null ? other.Unknown7.Clone() : null; 79 | payload_ = other.payload_.Clone(); 80 | errorMessage_ = other.errorMessage_; 81 | } 82 | 83 | public EncounterResponse Clone() { 84 | return new EncounterResponse(this); 85 | } 86 | 87 | /// Field number for the "unknown1" field. 88 | public const int Unknown1FieldNumber = 1; 89 | private int unknown1_; 90 | public int Unknown1 { 91 | get { return unknown1_; } 92 | set { 93 | unknown1_ = value; 94 | } 95 | } 96 | 97 | /// Field number for the "unknown2" field. 98 | public const int Unknown2FieldNumber = 2; 99 | private long unknown2_; 100 | public long Unknown2 { 101 | get { return unknown2_; } 102 | set { 103 | unknown2_ = value; 104 | } 105 | } 106 | 107 | /// Field number for the "api_url" field. 108 | public const int ApiUrlFieldNumber = 3; 109 | private string apiUrl_ = ""; 110 | public string ApiUrl { 111 | get { return apiUrl_; } 112 | set { 113 | apiUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 114 | } 115 | } 116 | 117 | /// Field number for the "unknown6" field. 118 | public const int Unknown6FieldNumber = 6; 119 | private global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6 unknown6_; 120 | public global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6 Unknown6 { 121 | get { return unknown6_; } 122 | set { 123 | unknown6_ = value; 124 | } 125 | } 126 | 127 | /// Field number for the "unknown7" field. 128 | public const int Unknown7FieldNumber = 7; 129 | private global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7 unknown7_; 130 | public global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7 Unknown7 { 131 | get { return unknown7_; } 132 | set { 133 | unknown7_ = value; 134 | } 135 | } 136 | 137 | /// Field number for the "payload" field. 138 | public const int PayloadFieldNumber = 100; 139 | private static readonly pb::FieldCodec _repeated_payload_codec 140 | = pb::FieldCodec.ForMessage(802, global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Payload.Parser); 141 | private readonly pbc::RepeatedField payload_ = new pbc::RepeatedField(); 142 | public pbc::RepeatedField Payload { 143 | get { return payload_; } 144 | } 145 | 146 | /// Field number for the "errorMessage" field. 147 | public const int ErrorMessageFieldNumber = 101; 148 | private string errorMessage_ = ""; 149 | /// 150 | /// Should be moved to an error-proto file if error is always 101 field 151 | /// 152 | public string ErrorMessage { 153 | get { return errorMessage_; } 154 | set { 155 | errorMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 156 | } 157 | } 158 | 159 | public override bool Equals(object other) { 160 | return Equals(other as EncounterResponse); 161 | } 162 | 163 | public bool Equals(EncounterResponse other) { 164 | if (ReferenceEquals(other, null)) { 165 | return false; 166 | } 167 | if (ReferenceEquals(other, this)) { 168 | return true; 169 | } 170 | if (Unknown1 != other.Unknown1) return false; 171 | if (Unknown2 != other.Unknown2) return false; 172 | if (ApiUrl != other.ApiUrl) return false; 173 | if (!object.Equals(Unknown6, other.Unknown6)) return false; 174 | if (!object.Equals(Unknown7, other.Unknown7)) return false; 175 | if(!payload_.Equals(other.payload_)) return false; 176 | if (ErrorMessage != other.ErrorMessage) return false; 177 | return true; 178 | } 179 | 180 | public override int GetHashCode() { 181 | int hash = 1; 182 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 183 | if (Unknown2 != 0L) hash ^= Unknown2.GetHashCode(); 184 | if (ApiUrl.Length != 0) hash ^= ApiUrl.GetHashCode(); 185 | if (unknown6_ != null) hash ^= Unknown6.GetHashCode(); 186 | if (unknown7_ != null) hash ^= Unknown7.GetHashCode(); 187 | hash ^= payload_.GetHashCode(); 188 | if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); 189 | return hash; 190 | } 191 | 192 | public override string ToString() { 193 | return pb::JsonFormatter.ToDiagnosticString(this); 194 | } 195 | 196 | public void WriteTo(pb::CodedOutputStream output) { 197 | if (Unknown1 != 0) { 198 | output.WriteRawTag(8); 199 | output.WriteInt32(Unknown1); 200 | } 201 | if (Unknown2 != 0L) { 202 | output.WriteRawTag(16); 203 | output.WriteInt64(Unknown2); 204 | } 205 | if (ApiUrl.Length != 0) { 206 | output.WriteRawTag(26); 207 | output.WriteString(ApiUrl); 208 | } 209 | if (unknown6_ != null) { 210 | output.WriteRawTag(50); 211 | output.WriteMessage(Unknown6); 212 | } 213 | if (unknown7_ != null) { 214 | output.WriteRawTag(58); 215 | output.WriteMessage(Unknown7); 216 | } 217 | payload_.WriteTo(output, _repeated_payload_codec); 218 | if (ErrorMessage.Length != 0) { 219 | output.WriteRawTag(170, 6); 220 | output.WriteString(ErrorMessage); 221 | } 222 | } 223 | 224 | public int CalculateSize() { 225 | int size = 0; 226 | if (Unknown1 != 0) { 227 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 228 | } 229 | if (Unknown2 != 0L) { 230 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown2); 231 | } 232 | if (ApiUrl.Length != 0) { 233 | size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiUrl); 234 | } 235 | if (unknown6_ != null) { 236 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown6); 237 | } 238 | if (unknown7_ != null) { 239 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown7); 240 | } 241 | size += payload_.CalculateSize(_repeated_payload_codec); 242 | if (ErrorMessage.Length != 0) { 243 | size += 2 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); 244 | } 245 | return size; 246 | } 247 | 248 | public void MergeFrom(EncounterResponse other) { 249 | if (other == null) { 250 | return; 251 | } 252 | if (other.Unknown1 != 0) { 253 | Unknown1 = other.Unknown1; 254 | } 255 | if (other.Unknown2 != 0L) { 256 | Unknown2 = other.Unknown2; 257 | } 258 | if (other.ApiUrl.Length != 0) { 259 | ApiUrl = other.ApiUrl; 260 | } 261 | if (other.unknown6_ != null) { 262 | if (unknown6_ == null) { 263 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6(); 264 | } 265 | Unknown6.MergeFrom(other.Unknown6); 266 | } 267 | if (other.unknown7_ != null) { 268 | if (unknown7_ == null) { 269 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7(); 270 | } 271 | Unknown7.MergeFrom(other.Unknown7); 272 | } 273 | payload_.Add(other.payload_); 274 | if (other.ErrorMessage.Length != 0) { 275 | ErrorMessage = other.ErrorMessage; 276 | } 277 | } 278 | 279 | public void MergeFrom(pb::CodedInputStream input) { 280 | uint tag; 281 | while ((tag = input.ReadTag()) != 0) { 282 | switch(tag) { 283 | default: 284 | input.SkipLastField(); 285 | break; 286 | case 8: { 287 | Unknown1 = input.ReadInt32(); 288 | break; 289 | } 290 | case 16: { 291 | Unknown2 = input.ReadInt64(); 292 | break; 293 | } 294 | case 26: { 295 | ApiUrl = input.ReadString(); 296 | break; 297 | } 298 | case 50: { 299 | if (unknown6_ == null) { 300 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6(); 301 | } 302 | input.ReadMessage(unknown6_); 303 | break; 304 | } 305 | case 58: { 306 | if (unknown7_ == null) { 307 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown7(); 308 | } 309 | input.ReadMessage(unknown7_); 310 | break; 311 | } 312 | case 802: { 313 | payload_.AddEntriesFrom(input, _repeated_payload_codec); 314 | break; 315 | } 316 | case 810: { 317 | ErrorMessage = input.ReadString(); 318 | break; 319 | } 320 | } 321 | } 322 | } 323 | 324 | #region Nested types 325 | /// Container for nested types declared in the EncounterResponse message type. 326 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 327 | public static partial class Types { 328 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 329 | public sealed partial class Unknown6 : pb::IMessage { 330 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown6()); 331 | public static pb::MessageParser Parser { get { return _parser; } } 332 | 333 | public static pbr::MessageDescriptor Descriptor { 334 | get { return global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Descriptor.NestedTypes[0]; } 335 | } 336 | 337 | pbr::MessageDescriptor pb::IMessage.Descriptor { 338 | get { return Descriptor; } 339 | } 340 | 341 | public Unknown6() { 342 | OnConstruction(); 343 | } 344 | 345 | partial void OnConstruction(); 346 | 347 | public Unknown6(Unknown6 other) : this() { 348 | unknown1_ = other.unknown1_; 349 | Unknown2 = other.unknown2_ != null ? other.Unknown2.Clone() : null; 350 | } 351 | 352 | public Unknown6 Clone() { 353 | return new Unknown6(this); 354 | } 355 | 356 | /// Field number for the "unknown1" field. 357 | public const int Unknown1FieldNumber = 1; 358 | private int unknown1_; 359 | public int Unknown1 { 360 | get { return unknown1_; } 361 | set { 362 | unknown1_ = value; 363 | } 364 | } 365 | 366 | /// Field number for the "unknown2" field. 367 | public const int Unknown2FieldNumber = 2; 368 | private global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2 unknown2_; 369 | public global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2 Unknown2 { 370 | get { return unknown2_; } 371 | set { 372 | unknown2_ = value; 373 | } 374 | } 375 | 376 | public override bool Equals(object other) { 377 | return Equals(other as Unknown6); 378 | } 379 | 380 | public bool Equals(Unknown6 other) { 381 | if (ReferenceEquals(other, null)) { 382 | return false; 383 | } 384 | if (ReferenceEquals(other, this)) { 385 | return true; 386 | } 387 | if (Unknown1 != other.Unknown1) return false; 388 | if (!object.Equals(Unknown2, other.Unknown2)) return false; 389 | return true; 390 | } 391 | 392 | public override int GetHashCode() { 393 | int hash = 1; 394 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 395 | if (unknown2_ != null) hash ^= Unknown2.GetHashCode(); 396 | return hash; 397 | } 398 | 399 | public override string ToString() { 400 | return pb::JsonFormatter.ToDiagnosticString(this); 401 | } 402 | 403 | public void WriteTo(pb::CodedOutputStream output) { 404 | if (Unknown1 != 0) { 405 | output.WriteRawTag(8); 406 | output.WriteInt32(Unknown1); 407 | } 408 | if (unknown2_ != null) { 409 | output.WriteRawTag(18); 410 | output.WriteMessage(Unknown2); 411 | } 412 | } 413 | 414 | public int CalculateSize() { 415 | int size = 0; 416 | if (Unknown1 != 0) { 417 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 418 | } 419 | if (unknown2_ != null) { 420 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown2); 421 | } 422 | return size; 423 | } 424 | 425 | public void MergeFrom(Unknown6 other) { 426 | if (other == null) { 427 | return; 428 | } 429 | if (other.Unknown1 != 0) { 430 | Unknown1 = other.Unknown1; 431 | } 432 | if (other.unknown2_ != null) { 433 | if (unknown2_ == null) { 434 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2(); 435 | } 436 | Unknown2.MergeFrom(other.Unknown2); 437 | } 438 | } 439 | 440 | public void MergeFrom(pb::CodedInputStream input) { 441 | uint tag; 442 | while ((tag = input.ReadTag()) != 0) { 443 | switch(tag) { 444 | default: 445 | input.SkipLastField(); 446 | break; 447 | case 8: { 448 | Unknown1 = input.ReadInt32(); 449 | break; 450 | } 451 | case 18: { 452 | if (unknown2_ == null) { 453 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Types.Unknown2(); 454 | } 455 | input.ReadMessage(unknown2_); 456 | break; 457 | } 458 | } 459 | } 460 | } 461 | 462 | #region Nested types 463 | /// Container for nested types declared in the Unknown6 message type. 464 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 465 | public static partial class Types { 466 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 467 | public sealed partial class Unknown2 : pb::IMessage { 468 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown2()); 469 | public static pb::MessageParser Parser { get { return _parser; } } 470 | 471 | public static pbr::MessageDescriptor Descriptor { 472 | get { return global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Types.Unknown6.Descriptor.NestedTypes[0]; } 473 | } 474 | 475 | pbr::MessageDescriptor pb::IMessage.Descriptor { 476 | get { return Descriptor; } 477 | } 478 | 479 | public Unknown2() { 480 | OnConstruction(); 481 | } 482 | 483 | partial void OnConstruction(); 484 | 485 | public Unknown2(Unknown2 other) : this() { 486 | unknown1_ = other.unknown1_; 487 | } 488 | 489 | public Unknown2 Clone() { 490 | return new Unknown2(this); 491 | } 492 | 493 | /// Field number for the "unknown1" field. 494 | public const int Unknown1FieldNumber = 1; 495 | private pb::ByteString unknown1_ = pb::ByteString.Empty; 496 | public pb::ByteString Unknown1 { 497 | get { return unknown1_; } 498 | set { 499 | unknown1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 500 | } 501 | } 502 | 503 | public override bool Equals(object other) { 504 | return Equals(other as Unknown2); 505 | } 506 | 507 | public bool Equals(Unknown2 other) { 508 | if (ReferenceEquals(other, null)) { 509 | return false; 510 | } 511 | if (ReferenceEquals(other, this)) { 512 | return true; 513 | } 514 | if (Unknown1 != other.Unknown1) return false; 515 | return true; 516 | } 517 | 518 | public override int GetHashCode() { 519 | int hash = 1; 520 | if (Unknown1.Length != 0) hash ^= Unknown1.GetHashCode(); 521 | return hash; 522 | } 523 | 524 | public override string ToString() { 525 | return pb::JsonFormatter.ToDiagnosticString(this); 526 | } 527 | 528 | public void WriteTo(pb::CodedOutputStream output) { 529 | if (Unknown1.Length != 0) { 530 | output.WriteRawTag(10); 531 | output.WriteBytes(Unknown1); 532 | } 533 | } 534 | 535 | public int CalculateSize() { 536 | int size = 0; 537 | if (Unknown1.Length != 0) { 538 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown1); 539 | } 540 | return size; 541 | } 542 | 543 | public void MergeFrom(Unknown2 other) { 544 | if (other == null) { 545 | return; 546 | } 547 | if (other.Unknown1.Length != 0) { 548 | Unknown1 = other.Unknown1; 549 | } 550 | } 551 | 552 | public void MergeFrom(pb::CodedInputStream input) { 553 | uint tag; 554 | while ((tag = input.ReadTag()) != 0) { 555 | switch(tag) { 556 | default: 557 | input.SkipLastField(); 558 | break; 559 | case 10: { 560 | Unknown1 = input.ReadBytes(); 561 | break; 562 | } 563 | } 564 | } 565 | } 566 | 567 | } 568 | 569 | } 570 | #endregion 571 | 572 | } 573 | 574 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 575 | public sealed partial class Unknown7 : pb::IMessage { 576 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown7()); 577 | public static pb::MessageParser Parser { get { return _parser; } } 578 | 579 | public static pbr::MessageDescriptor Descriptor { 580 | get { return global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Descriptor.NestedTypes[1]; } 581 | } 582 | 583 | pbr::MessageDescriptor pb::IMessage.Descriptor { 584 | get { return Descriptor; } 585 | } 586 | 587 | public Unknown7() { 588 | OnConstruction(); 589 | } 590 | 591 | partial void OnConstruction(); 592 | 593 | public Unknown7(Unknown7 other) : this() { 594 | unknown71_ = other.unknown71_; 595 | unknown72_ = other.unknown72_; 596 | unknown73_ = other.unknown73_; 597 | } 598 | 599 | public Unknown7 Clone() { 600 | return new Unknown7(this); 601 | } 602 | 603 | /// Field number for the "unknown71" field. 604 | public const int Unknown71FieldNumber = 1; 605 | private pb::ByteString unknown71_ = pb::ByteString.Empty; 606 | public pb::ByteString Unknown71 { 607 | get { return unknown71_; } 608 | set { 609 | unknown71_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 610 | } 611 | } 612 | 613 | /// Field number for the "unknown72" field. 614 | public const int Unknown72FieldNumber = 2; 615 | private long unknown72_; 616 | public long Unknown72 { 617 | get { return unknown72_; } 618 | set { 619 | unknown72_ = value; 620 | } 621 | } 622 | 623 | /// Field number for the "unknown73" field. 624 | public const int Unknown73FieldNumber = 3; 625 | private pb::ByteString unknown73_ = pb::ByteString.Empty; 626 | public pb::ByteString Unknown73 { 627 | get { return unknown73_; } 628 | set { 629 | unknown73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 630 | } 631 | } 632 | 633 | public override bool Equals(object other) { 634 | return Equals(other as Unknown7); 635 | } 636 | 637 | public bool Equals(Unknown7 other) { 638 | if (ReferenceEquals(other, null)) { 639 | return false; 640 | } 641 | if (ReferenceEquals(other, this)) { 642 | return true; 643 | } 644 | if (Unknown71 != other.Unknown71) return false; 645 | if (Unknown72 != other.Unknown72) return false; 646 | if (Unknown73 != other.Unknown73) return false; 647 | return true; 648 | } 649 | 650 | public override int GetHashCode() { 651 | int hash = 1; 652 | if (Unknown71.Length != 0) hash ^= Unknown71.GetHashCode(); 653 | if (Unknown72 != 0L) hash ^= Unknown72.GetHashCode(); 654 | if (Unknown73.Length != 0) hash ^= Unknown73.GetHashCode(); 655 | return hash; 656 | } 657 | 658 | public override string ToString() { 659 | return pb::JsonFormatter.ToDiagnosticString(this); 660 | } 661 | 662 | public void WriteTo(pb::CodedOutputStream output) { 663 | if (Unknown71.Length != 0) { 664 | output.WriteRawTag(10); 665 | output.WriteBytes(Unknown71); 666 | } 667 | if (Unknown72 != 0L) { 668 | output.WriteRawTag(16); 669 | output.WriteInt64(Unknown72); 670 | } 671 | if (Unknown73.Length != 0) { 672 | output.WriteRawTag(26); 673 | output.WriteBytes(Unknown73); 674 | } 675 | } 676 | 677 | public int CalculateSize() { 678 | int size = 0; 679 | if (Unknown71.Length != 0) { 680 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown71); 681 | } 682 | if (Unknown72 != 0L) { 683 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown72); 684 | } 685 | if (Unknown73.Length != 0) { 686 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown73); 687 | } 688 | return size; 689 | } 690 | 691 | public void MergeFrom(Unknown7 other) { 692 | if (other == null) { 693 | return; 694 | } 695 | if (other.Unknown71.Length != 0) { 696 | Unknown71 = other.Unknown71; 697 | } 698 | if (other.Unknown72 != 0L) { 699 | Unknown72 = other.Unknown72; 700 | } 701 | if (other.Unknown73.Length != 0) { 702 | Unknown73 = other.Unknown73; 703 | } 704 | } 705 | 706 | public void MergeFrom(pb::CodedInputStream input) { 707 | uint tag; 708 | while ((tag = input.ReadTag()) != 0) { 709 | switch(tag) { 710 | default: 711 | input.SkipLastField(); 712 | break; 713 | case 10: { 714 | Unknown71 = input.ReadBytes(); 715 | break; 716 | } 717 | case 16: { 718 | Unknown72 = input.ReadInt64(); 719 | break; 720 | } 721 | case 26: { 722 | Unknown73 = input.ReadBytes(); 723 | break; 724 | } 725 | } 726 | } 727 | } 728 | 729 | } 730 | 731 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 732 | public sealed partial class Payload : pb::IMessage { 733 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); 734 | public static pb::MessageParser Parser { get { return _parser; } } 735 | 736 | public static pbr::MessageDescriptor Descriptor { 737 | get { return global::PokemonGo.RocketAPI.GeneratedCode.EncounterResponse.Descriptor.NestedTypes[2]; } 738 | } 739 | 740 | pbr::MessageDescriptor pb::IMessage.Descriptor { 741 | get { return Descriptor; } 742 | } 743 | 744 | public Payload() { 745 | OnConstruction(); 746 | } 747 | 748 | partial void OnConstruction(); 749 | 750 | public Payload(Payload other) : this() { 751 | pokemon_ = other.pokemon_; 752 | background_ = other.background_; 753 | status_ = other.status_; 754 | captureProbability_ = other.captureProbability_; 755 | } 756 | 757 | public Payload Clone() { 758 | return new Payload(this); 759 | } 760 | 761 | /// Field number for the "Pokemon" field. 762 | public const int PokemonFieldNumber = 1; 763 | private int pokemon_; 764 | public int Pokemon { 765 | get { return pokemon_; } 766 | set { 767 | pokemon_ = value; 768 | } 769 | } 770 | 771 | /// Field number for the "Background" field. 772 | public const int BackgroundFieldNumber = 2; 773 | private int background_; 774 | public int Background { 775 | get { return background_; } 776 | set { 777 | background_ = value; 778 | } 779 | } 780 | 781 | /// Field number for the "Status" field. 782 | public const int StatusFieldNumber = 3; 783 | private int status_; 784 | public int Status { 785 | get { return status_; } 786 | set { 787 | status_ = value; 788 | } 789 | } 790 | 791 | /// Field number for the "CaptureProbability" field. 792 | public const int CaptureProbabilityFieldNumber = 4; 793 | private int captureProbability_; 794 | public int CaptureProbability { 795 | get { return captureProbability_; } 796 | set { 797 | captureProbability_ = value; 798 | } 799 | } 800 | 801 | public override bool Equals(object other) { 802 | return Equals(other as Payload); 803 | } 804 | 805 | public bool Equals(Payload other) { 806 | if (ReferenceEquals(other, null)) { 807 | return false; 808 | } 809 | if (ReferenceEquals(other, this)) { 810 | return true; 811 | } 812 | if (Pokemon != other.Pokemon) return false; 813 | if (Background != other.Background) return false; 814 | if (Status != other.Status) return false; 815 | if (CaptureProbability != other.CaptureProbability) return false; 816 | return true; 817 | } 818 | 819 | public override int GetHashCode() { 820 | int hash = 1; 821 | if (Pokemon != 0) hash ^= Pokemon.GetHashCode(); 822 | if (Background != 0) hash ^= Background.GetHashCode(); 823 | if (Status != 0) hash ^= Status.GetHashCode(); 824 | if (CaptureProbability != 0) hash ^= CaptureProbability.GetHashCode(); 825 | return hash; 826 | } 827 | 828 | public override string ToString() { 829 | return pb::JsonFormatter.ToDiagnosticString(this); 830 | } 831 | 832 | public void WriteTo(pb::CodedOutputStream output) { 833 | if (Pokemon != 0) { 834 | output.WriteRawTag(8); 835 | output.WriteInt32(Pokemon); 836 | } 837 | if (Background != 0) { 838 | output.WriteRawTag(16); 839 | output.WriteInt32(Background); 840 | } 841 | if (Status != 0) { 842 | output.WriteRawTag(24); 843 | output.WriteInt32(Status); 844 | } 845 | if (CaptureProbability != 0) { 846 | output.WriteRawTag(32); 847 | output.WriteInt32(CaptureProbability); 848 | } 849 | } 850 | 851 | public int CalculateSize() { 852 | int size = 0; 853 | if (Pokemon != 0) { 854 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Pokemon); 855 | } 856 | if (Background != 0) { 857 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Background); 858 | } 859 | if (Status != 0) { 860 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Status); 861 | } 862 | if (CaptureProbability != 0) { 863 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(CaptureProbability); 864 | } 865 | return size; 866 | } 867 | 868 | public void MergeFrom(Payload other) { 869 | if (other == null) { 870 | return; 871 | } 872 | if (other.Pokemon != 0) { 873 | Pokemon = other.Pokemon; 874 | } 875 | if (other.Background != 0) { 876 | Background = other.Background; 877 | } 878 | if (other.Status != 0) { 879 | Status = other.Status; 880 | } 881 | if (other.CaptureProbability != 0) { 882 | CaptureProbability = other.CaptureProbability; 883 | } 884 | } 885 | 886 | public void MergeFrom(pb::CodedInputStream input) { 887 | uint tag; 888 | while ((tag = input.ReadTag()) != 0) { 889 | switch(tag) { 890 | default: 891 | input.SkipLastField(); 892 | break; 893 | case 8: { 894 | Pokemon = input.ReadInt32(); 895 | break; 896 | } 897 | case 16: { 898 | Background = input.ReadInt32(); 899 | break; 900 | } 901 | case 24: { 902 | Status = input.ReadInt32(); 903 | break; 904 | } 905 | case 32: { 906 | CaptureProbability = input.ReadInt32(); 907 | break; 908 | } 909 | } 910 | } 911 | } 912 | 913 | } 914 | 915 | } 916 | #endregion 917 | 918 | } 919 | 920 | #endregion 921 | 922 | } 923 | 924 | #endregion Designer generated code 925 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/GeneratedCode/FortSearchResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: FortSearchResponse.proto 3 | #pragma warning disable 1591, 0612, 3021 4 | #region Designer generated code 5 | 6 | using pb = global::Google.Protobuf; 7 | using pbc = global::Google.Protobuf.Collections; 8 | using pbr = global::Google.Protobuf.Reflection; 9 | using scg = global::System.Collections.Generic; 10 | namespace PokemonGo.RocketAPI.GeneratedCode { 11 | 12 | /// Holder for reflection information generated from FortSearchResponse.proto 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 | public static partial class FortSearchResponseReflection { 15 | 16 | #region Descriptor 17 | /// File descriptor for FortSearchResponse.proto 18 | public static pbr::FileDescriptor Descriptor { 19 | get { return descriptor; } 20 | } 21 | private static pbr::FileDescriptor descriptor; 22 | 23 | static FortSearchResponseReflection() { 24 | byte[] descriptorData = global::System.Convert.FromBase64String( 25 | string.Concat( 26 | "ChhGb3J0U2VhcmNoUmVzcG9uc2UucHJvdG8SIVBva2Vtb25Hby5Sb2NrZXRB", 27 | "UEkuR2VuZXJhdGVkQ29kZSK3BgoSRm9ydFNlYXJjaFJlc3BvbnNlEhAKCHVu", 28 | "a25vd24xGAEgASgFEhAKCHVua25vd24yGAIgASgDEg8KB2FwaV91cmwYAyAB", 29 | "KAkSUAoIdW5rbm93bjYYBiABKAsyPi5Qb2tlbW9uR28uUm9ja2V0QVBJLkdl", 30 | "bmVyYXRlZENvZGUuRm9ydFNlYXJjaFJlc3BvbnNlLlVua25vd242ElAKCHVu", 31 | "a25vd243GAcgASgLMj4uUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5lcmF0ZWRD", 32 | "b2RlLkZvcnRTZWFyY2hSZXNwb25zZS5Vbmtub3duNxJOCgdwYXlsb2FkGGQg", 33 | "AygLMj0uUG9rZW1vbkdvLlJvY2tldEFQSS5HZW5lcmF0ZWRDb2RlLkZvcnRT", 34 | "ZWFyY2hSZXNwb25zZS5QYXlsb2FkEhQKDGVycm9yTWVzc2FnZRhlIAEoCRqV", 35 | "AQoIVW5rbm93bjYSEAoIdW5rbm93bjEYASABKAUSWQoIdW5rbm93bjIYAiAB", 36 | "KAsyRy5Qb2tlbW9uR28uUm9ja2V0QVBJLkdlbmVyYXRlZENvZGUuRm9ydFNl", 37 | "YXJjaFJlc3BvbnNlLlVua25vd242LlVua25vd24yGhwKCFVua25vd24yEhAK", 38 | "CHVua25vd24xGAEgASgMGkMKCFVua25vd243EhEKCXVua25vd243MRgBIAEo", 39 | "DBIRCgl1bmtub3duNzIYAiABKAMSEQoJdW5rbm93bjczGAMgASgMGtsBCgdQ", 40 | "YXlsb2FkEg4KBlJlc3VsdBgBIAEoBRJJCgVJdGVtcxgCIAMoCzI6LlBva2Vt", 41 | "b25Hby5Sb2NrZXRBUEkuR2VuZXJhdGVkQ29kZS5Gb3J0U2VhcmNoUmVzcG9u", 42 | "c2UuSXRlbRITCgtHZW1zQXdhcmRlZBgDIAEoBRISCgpFZ2dQb2tlbW9uGAQg", 43 | "ASgFEhEKCVhwQXdhcmRlZBgFIAEoBRIYChBDb29sZG93bkNvbXBsZXRlGAYg", 44 | "ASgDEh8KF0NoYWluSGFja1NlcXVlbmNlTnVtYmVyGAcgASgFGicKBEl0ZW0S", 45 | "DAoESXRlbRgBIAEoBRIRCglJdGVtQ291bnQYAiABKAViBnByb3RvMw==")); 46 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 47 | new pbr::FileDescriptor[] { }, 48 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 49 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Parser, new[]{ "Unknown1", "Unknown2", "ApiUrl", "Unknown6", "Unknown7", "Payload", "ErrorMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Parser, new[]{ "Unknown1", "Unknown2" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2.Parser, new[]{ "Unknown1" }, null, null, null)}), 50 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7.Parser, new[]{ "Unknown71", "Unknown72", "Unknown73" }, null, null, null), 51 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Payload), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Payload.Parser, new[]{ "Result", "Items", "GemsAwarded", "EggPokemon", "XpAwarded", "CooldownComplete", "ChainHackSequenceNumber" }, null, null, null), 52 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Item), global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Item.Parser, new[]{ "Item_", "ItemCount" }, null, null, null)}) 53 | })); 54 | } 55 | #endregion 56 | 57 | } 58 | #region Messages 59 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 60 | public sealed partial class FortSearchResponse : pb::IMessage { 61 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FortSearchResponse()); 62 | public static pb::MessageParser Parser { get { return _parser; } } 63 | 64 | public static pbr::MessageDescriptor Descriptor { 65 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponseReflection.Descriptor.MessageTypes[0]; } 66 | } 67 | 68 | pbr::MessageDescriptor pb::IMessage.Descriptor { 69 | get { return Descriptor; } 70 | } 71 | 72 | public FortSearchResponse() { 73 | OnConstruction(); 74 | } 75 | 76 | partial void OnConstruction(); 77 | 78 | public FortSearchResponse(FortSearchResponse other) : this() { 79 | unknown1_ = other.unknown1_; 80 | unknown2_ = other.unknown2_; 81 | apiUrl_ = other.apiUrl_; 82 | Unknown6 = other.unknown6_ != null ? other.Unknown6.Clone() : null; 83 | Unknown7 = other.unknown7_ != null ? other.Unknown7.Clone() : null; 84 | payload_ = other.payload_.Clone(); 85 | errorMessage_ = other.errorMessage_; 86 | } 87 | 88 | public FortSearchResponse Clone() { 89 | return new FortSearchResponse(this); 90 | } 91 | 92 | /// Field number for the "unknown1" field. 93 | public const int Unknown1FieldNumber = 1; 94 | private int unknown1_; 95 | public int Unknown1 { 96 | get { return unknown1_; } 97 | set { 98 | unknown1_ = value; 99 | } 100 | } 101 | 102 | /// Field number for the "unknown2" field. 103 | public const int Unknown2FieldNumber = 2; 104 | private long unknown2_; 105 | public long Unknown2 { 106 | get { return unknown2_; } 107 | set { 108 | unknown2_ = value; 109 | } 110 | } 111 | 112 | /// Field number for the "api_url" field. 113 | public const int ApiUrlFieldNumber = 3; 114 | private string apiUrl_ = ""; 115 | public string ApiUrl { 116 | get { return apiUrl_; } 117 | set { 118 | apiUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 119 | } 120 | } 121 | 122 | /// Field number for the "unknown6" field. 123 | public const int Unknown6FieldNumber = 6; 124 | private global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6 unknown6_; 125 | public global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6 Unknown6 { 126 | get { return unknown6_; } 127 | set { 128 | unknown6_ = value; 129 | } 130 | } 131 | 132 | /// Field number for the "unknown7" field. 133 | public const int Unknown7FieldNumber = 7; 134 | private global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7 unknown7_; 135 | public global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7 Unknown7 { 136 | get { return unknown7_; } 137 | set { 138 | unknown7_ = value; 139 | } 140 | } 141 | 142 | /// Field number for the "payload" field. 143 | public const int PayloadFieldNumber = 100; 144 | private static readonly pb::FieldCodec _repeated_payload_codec 145 | = pb::FieldCodec.ForMessage(802, global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Payload.Parser); 146 | private readonly pbc::RepeatedField payload_ = new pbc::RepeatedField(); 147 | public pbc::RepeatedField Payload { 148 | get { return payload_; } 149 | } 150 | 151 | /// Field number for the "errorMessage" field. 152 | public const int ErrorMessageFieldNumber = 101; 153 | private string errorMessage_ = ""; 154 | /// 155 | /// Should be moved to an error-proto file if error is always 101 field 156 | /// 157 | public string ErrorMessage { 158 | get { return errorMessage_; } 159 | set { 160 | errorMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 161 | } 162 | } 163 | 164 | public override bool Equals(object other) { 165 | return Equals(other as FortSearchResponse); 166 | } 167 | 168 | public bool Equals(FortSearchResponse other) { 169 | if (ReferenceEquals(other, null)) { 170 | return false; 171 | } 172 | if (ReferenceEquals(other, this)) { 173 | return true; 174 | } 175 | if (Unknown1 != other.Unknown1) return false; 176 | if (Unknown2 != other.Unknown2) return false; 177 | if (ApiUrl != other.ApiUrl) return false; 178 | if (!object.Equals(Unknown6, other.Unknown6)) return false; 179 | if (!object.Equals(Unknown7, other.Unknown7)) return false; 180 | if(!payload_.Equals(other.payload_)) return false; 181 | if (ErrorMessage != other.ErrorMessage) return false; 182 | return true; 183 | } 184 | 185 | public override int GetHashCode() { 186 | int hash = 1; 187 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 188 | if (Unknown2 != 0L) hash ^= Unknown2.GetHashCode(); 189 | if (ApiUrl.Length != 0) hash ^= ApiUrl.GetHashCode(); 190 | if (unknown6_ != null) hash ^= Unknown6.GetHashCode(); 191 | if (unknown7_ != null) hash ^= Unknown7.GetHashCode(); 192 | hash ^= payload_.GetHashCode(); 193 | if (ErrorMessage.Length != 0) hash ^= ErrorMessage.GetHashCode(); 194 | return hash; 195 | } 196 | 197 | public override string ToString() { 198 | return pb::JsonFormatter.ToDiagnosticString(this); 199 | } 200 | 201 | public void WriteTo(pb::CodedOutputStream output) { 202 | if (Unknown1 != 0) { 203 | output.WriteRawTag(8); 204 | output.WriteInt32(Unknown1); 205 | } 206 | if (Unknown2 != 0L) { 207 | output.WriteRawTag(16); 208 | output.WriteInt64(Unknown2); 209 | } 210 | if (ApiUrl.Length != 0) { 211 | output.WriteRawTag(26); 212 | output.WriteString(ApiUrl); 213 | } 214 | if (unknown6_ != null) { 215 | output.WriteRawTag(50); 216 | output.WriteMessage(Unknown6); 217 | } 218 | if (unknown7_ != null) { 219 | output.WriteRawTag(58); 220 | output.WriteMessage(Unknown7); 221 | } 222 | payload_.WriteTo(output, _repeated_payload_codec); 223 | if (ErrorMessage.Length != 0) { 224 | output.WriteRawTag(170, 6); 225 | output.WriteString(ErrorMessage); 226 | } 227 | } 228 | 229 | public int CalculateSize() { 230 | int size = 0; 231 | if (Unknown1 != 0) { 232 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 233 | } 234 | if (Unknown2 != 0L) { 235 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown2); 236 | } 237 | if (ApiUrl.Length != 0) { 238 | size += 1 + pb::CodedOutputStream.ComputeStringSize(ApiUrl); 239 | } 240 | if (unknown6_ != null) { 241 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown6); 242 | } 243 | if (unknown7_ != null) { 244 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown7); 245 | } 246 | size += payload_.CalculateSize(_repeated_payload_codec); 247 | if (ErrorMessage.Length != 0) { 248 | size += 2 + pb::CodedOutputStream.ComputeStringSize(ErrorMessage); 249 | } 250 | return size; 251 | } 252 | 253 | public void MergeFrom(FortSearchResponse other) { 254 | if (other == null) { 255 | return; 256 | } 257 | if (other.Unknown1 != 0) { 258 | Unknown1 = other.Unknown1; 259 | } 260 | if (other.Unknown2 != 0L) { 261 | Unknown2 = other.Unknown2; 262 | } 263 | if (other.ApiUrl.Length != 0) { 264 | ApiUrl = other.ApiUrl; 265 | } 266 | if (other.unknown6_ != null) { 267 | if (unknown6_ == null) { 268 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6(); 269 | } 270 | Unknown6.MergeFrom(other.Unknown6); 271 | } 272 | if (other.unknown7_ != null) { 273 | if (unknown7_ == null) { 274 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7(); 275 | } 276 | Unknown7.MergeFrom(other.Unknown7); 277 | } 278 | payload_.Add(other.payload_); 279 | if (other.ErrorMessage.Length != 0) { 280 | ErrorMessage = other.ErrorMessage; 281 | } 282 | } 283 | 284 | public void MergeFrom(pb::CodedInputStream input) { 285 | uint tag; 286 | while ((tag = input.ReadTag()) != 0) { 287 | switch(tag) { 288 | default: 289 | input.SkipLastField(); 290 | break; 291 | case 8: { 292 | Unknown1 = input.ReadInt32(); 293 | break; 294 | } 295 | case 16: { 296 | Unknown2 = input.ReadInt64(); 297 | break; 298 | } 299 | case 26: { 300 | ApiUrl = input.ReadString(); 301 | break; 302 | } 303 | case 50: { 304 | if (unknown6_ == null) { 305 | unknown6_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6(); 306 | } 307 | input.ReadMessage(unknown6_); 308 | break; 309 | } 310 | case 58: { 311 | if (unknown7_ == null) { 312 | unknown7_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown7(); 313 | } 314 | input.ReadMessage(unknown7_); 315 | break; 316 | } 317 | case 802: { 318 | payload_.AddEntriesFrom(input, _repeated_payload_codec); 319 | break; 320 | } 321 | case 810: { 322 | ErrorMessage = input.ReadString(); 323 | break; 324 | } 325 | } 326 | } 327 | } 328 | 329 | #region Nested types 330 | /// Container for nested types declared in the FortSearchResponse message type. 331 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 332 | public static partial class Types { 333 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 334 | public sealed partial class Unknown6 : pb::IMessage { 335 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown6()); 336 | public static pb::MessageParser Parser { get { return _parser; } } 337 | 338 | public static pbr::MessageDescriptor Descriptor { 339 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Descriptor.NestedTypes[0]; } 340 | } 341 | 342 | pbr::MessageDescriptor pb::IMessage.Descriptor { 343 | get { return Descriptor; } 344 | } 345 | 346 | public Unknown6() { 347 | OnConstruction(); 348 | } 349 | 350 | partial void OnConstruction(); 351 | 352 | public Unknown6(Unknown6 other) : this() { 353 | unknown1_ = other.unknown1_; 354 | Unknown2 = other.unknown2_ != null ? other.Unknown2.Clone() : null; 355 | } 356 | 357 | public Unknown6 Clone() { 358 | return new Unknown6(this); 359 | } 360 | 361 | /// Field number for the "unknown1" field. 362 | public const int Unknown1FieldNumber = 1; 363 | private int unknown1_; 364 | public int Unknown1 { 365 | get { return unknown1_; } 366 | set { 367 | unknown1_ = value; 368 | } 369 | } 370 | 371 | /// Field number for the "unknown2" field. 372 | public const int Unknown2FieldNumber = 2; 373 | private global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2 unknown2_; 374 | public global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2 Unknown2 { 375 | get { return unknown2_; } 376 | set { 377 | unknown2_ = value; 378 | } 379 | } 380 | 381 | public override bool Equals(object other) { 382 | return Equals(other as Unknown6); 383 | } 384 | 385 | public bool Equals(Unknown6 other) { 386 | if (ReferenceEquals(other, null)) { 387 | return false; 388 | } 389 | if (ReferenceEquals(other, this)) { 390 | return true; 391 | } 392 | if (Unknown1 != other.Unknown1) return false; 393 | if (!object.Equals(Unknown2, other.Unknown2)) return false; 394 | return true; 395 | } 396 | 397 | public override int GetHashCode() { 398 | int hash = 1; 399 | if (Unknown1 != 0) hash ^= Unknown1.GetHashCode(); 400 | if (unknown2_ != null) hash ^= Unknown2.GetHashCode(); 401 | return hash; 402 | } 403 | 404 | public override string ToString() { 405 | return pb::JsonFormatter.ToDiagnosticString(this); 406 | } 407 | 408 | public void WriteTo(pb::CodedOutputStream output) { 409 | if (Unknown1 != 0) { 410 | output.WriteRawTag(8); 411 | output.WriteInt32(Unknown1); 412 | } 413 | if (unknown2_ != null) { 414 | output.WriteRawTag(18); 415 | output.WriteMessage(Unknown2); 416 | } 417 | } 418 | 419 | public int CalculateSize() { 420 | int size = 0; 421 | if (Unknown1 != 0) { 422 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Unknown1); 423 | } 424 | if (unknown2_ != null) { 425 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Unknown2); 426 | } 427 | return size; 428 | } 429 | 430 | public void MergeFrom(Unknown6 other) { 431 | if (other == null) { 432 | return; 433 | } 434 | if (other.Unknown1 != 0) { 435 | Unknown1 = other.Unknown1; 436 | } 437 | if (other.unknown2_ != null) { 438 | if (unknown2_ == null) { 439 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2(); 440 | } 441 | Unknown2.MergeFrom(other.Unknown2); 442 | } 443 | } 444 | 445 | public void MergeFrom(pb::CodedInputStream input) { 446 | uint tag; 447 | while ((tag = input.ReadTag()) != 0) { 448 | switch(tag) { 449 | default: 450 | input.SkipLastField(); 451 | break; 452 | case 8: { 453 | Unknown1 = input.ReadInt32(); 454 | break; 455 | } 456 | case 18: { 457 | if (unknown2_ == null) { 458 | unknown2_ = new global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Types.Unknown2(); 459 | } 460 | input.ReadMessage(unknown2_); 461 | break; 462 | } 463 | } 464 | } 465 | } 466 | 467 | #region Nested types 468 | /// Container for nested types declared in the Unknown6 message type. 469 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 470 | public static partial class Types { 471 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 472 | public sealed partial class Unknown2 : pb::IMessage { 473 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown2()); 474 | public static pb::MessageParser Parser { get { return _parser; } } 475 | 476 | public static pbr::MessageDescriptor Descriptor { 477 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Unknown6.Descriptor.NestedTypes[0]; } 478 | } 479 | 480 | pbr::MessageDescriptor pb::IMessage.Descriptor { 481 | get { return Descriptor; } 482 | } 483 | 484 | public Unknown2() { 485 | OnConstruction(); 486 | } 487 | 488 | partial void OnConstruction(); 489 | 490 | public Unknown2(Unknown2 other) : this() { 491 | unknown1_ = other.unknown1_; 492 | } 493 | 494 | public Unknown2 Clone() { 495 | return new Unknown2(this); 496 | } 497 | 498 | /// Field number for the "unknown1" field. 499 | public const int Unknown1FieldNumber = 1; 500 | private pb::ByteString unknown1_ = pb::ByteString.Empty; 501 | public pb::ByteString Unknown1 { 502 | get { return unknown1_; } 503 | set { 504 | unknown1_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 505 | } 506 | } 507 | 508 | public override bool Equals(object other) { 509 | return Equals(other as Unknown2); 510 | } 511 | 512 | public bool Equals(Unknown2 other) { 513 | if (ReferenceEquals(other, null)) { 514 | return false; 515 | } 516 | if (ReferenceEquals(other, this)) { 517 | return true; 518 | } 519 | if (Unknown1 != other.Unknown1) return false; 520 | return true; 521 | } 522 | 523 | public override int GetHashCode() { 524 | int hash = 1; 525 | if (Unknown1.Length != 0) hash ^= Unknown1.GetHashCode(); 526 | return hash; 527 | } 528 | 529 | public override string ToString() { 530 | return pb::JsonFormatter.ToDiagnosticString(this); 531 | } 532 | 533 | public void WriteTo(pb::CodedOutputStream output) { 534 | if (Unknown1.Length != 0) { 535 | output.WriteRawTag(10); 536 | output.WriteBytes(Unknown1); 537 | } 538 | } 539 | 540 | public int CalculateSize() { 541 | int size = 0; 542 | if (Unknown1.Length != 0) { 543 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown1); 544 | } 545 | return size; 546 | } 547 | 548 | public void MergeFrom(Unknown2 other) { 549 | if (other == null) { 550 | return; 551 | } 552 | if (other.Unknown1.Length != 0) { 553 | Unknown1 = other.Unknown1; 554 | } 555 | } 556 | 557 | public void MergeFrom(pb::CodedInputStream input) { 558 | uint tag; 559 | while ((tag = input.ReadTag()) != 0) { 560 | switch(tag) { 561 | default: 562 | input.SkipLastField(); 563 | break; 564 | case 10: { 565 | Unknown1 = input.ReadBytes(); 566 | break; 567 | } 568 | } 569 | } 570 | } 571 | 572 | } 573 | 574 | } 575 | #endregion 576 | 577 | } 578 | 579 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 580 | public sealed partial class Unknown7 : pb::IMessage { 581 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Unknown7()); 582 | public static pb::MessageParser Parser { get { return _parser; } } 583 | 584 | public static pbr::MessageDescriptor Descriptor { 585 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Descriptor.NestedTypes[1]; } 586 | } 587 | 588 | pbr::MessageDescriptor pb::IMessage.Descriptor { 589 | get { return Descriptor; } 590 | } 591 | 592 | public Unknown7() { 593 | OnConstruction(); 594 | } 595 | 596 | partial void OnConstruction(); 597 | 598 | public Unknown7(Unknown7 other) : this() { 599 | unknown71_ = other.unknown71_; 600 | unknown72_ = other.unknown72_; 601 | unknown73_ = other.unknown73_; 602 | } 603 | 604 | public Unknown7 Clone() { 605 | return new Unknown7(this); 606 | } 607 | 608 | /// Field number for the "unknown71" field. 609 | public const int Unknown71FieldNumber = 1; 610 | private pb::ByteString unknown71_ = pb::ByteString.Empty; 611 | public pb::ByteString Unknown71 { 612 | get { return unknown71_; } 613 | set { 614 | unknown71_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 615 | } 616 | } 617 | 618 | /// Field number for the "unknown72" field. 619 | public const int Unknown72FieldNumber = 2; 620 | private long unknown72_; 621 | public long Unknown72 { 622 | get { return unknown72_; } 623 | set { 624 | unknown72_ = value; 625 | } 626 | } 627 | 628 | /// Field number for the "unknown73" field. 629 | public const int Unknown73FieldNumber = 3; 630 | private pb::ByteString unknown73_ = pb::ByteString.Empty; 631 | public pb::ByteString Unknown73 { 632 | get { return unknown73_; } 633 | set { 634 | unknown73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 635 | } 636 | } 637 | 638 | public override bool Equals(object other) { 639 | return Equals(other as Unknown7); 640 | } 641 | 642 | public bool Equals(Unknown7 other) { 643 | if (ReferenceEquals(other, null)) { 644 | return false; 645 | } 646 | if (ReferenceEquals(other, this)) { 647 | return true; 648 | } 649 | if (Unknown71 != other.Unknown71) return false; 650 | if (Unknown72 != other.Unknown72) return false; 651 | if (Unknown73 != other.Unknown73) return false; 652 | return true; 653 | } 654 | 655 | public override int GetHashCode() { 656 | int hash = 1; 657 | if (Unknown71.Length != 0) hash ^= Unknown71.GetHashCode(); 658 | if (Unknown72 != 0L) hash ^= Unknown72.GetHashCode(); 659 | if (Unknown73.Length != 0) hash ^= Unknown73.GetHashCode(); 660 | return hash; 661 | } 662 | 663 | public override string ToString() { 664 | return pb::JsonFormatter.ToDiagnosticString(this); 665 | } 666 | 667 | public void WriteTo(pb::CodedOutputStream output) { 668 | if (Unknown71.Length != 0) { 669 | output.WriteRawTag(10); 670 | output.WriteBytes(Unknown71); 671 | } 672 | if (Unknown72 != 0L) { 673 | output.WriteRawTag(16); 674 | output.WriteInt64(Unknown72); 675 | } 676 | if (Unknown73.Length != 0) { 677 | output.WriteRawTag(26); 678 | output.WriteBytes(Unknown73); 679 | } 680 | } 681 | 682 | public int CalculateSize() { 683 | int size = 0; 684 | if (Unknown71.Length != 0) { 685 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown71); 686 | } 687 | if (Unknown72 != 0L) { 688 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(Unknown72); 689 | } 690 | if (Unknown73.Length != 0) { 691 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Unknown73); 692 | } 693 | return size; 694 | } 695 | 696 | public void MergeFrom(Unknown7 other) { 697 | if (other == null) { 698 | return; 699 | } 700 | if (other.Unknown71.Length != 0) { 701 | Unknown71 = other.Unknown71; 702 | } 703 | if (other.Unknown72 != 0L) { 704 | Unknown72 = other.Unknown72; 705 | } 706 | if (other.Unknown73.Length != 0) { 707 | Unknown73 = other.Unknown73; 708 | } 709 | } 710 | 711 | public void MergeFrom(pb::CodedInputStream input) { 712 | uint tag; 713 | while ((tag = input.ReadTag()) != 0) { 714 | switch(tag) { 715 | default: 716 | input.SkipLastField(); 717 | break; 718 | case 10: { 719 | Unknown71 = input.ReadBytes(); 720 | break; 721 | } 722 | case 16: { 723 | Unknown72 = input.ReadInt64(); 724 | break; 725 | } 726 | case 26: { 727 | Unknown73 = input.ReadBytes(); 728 | break; 729 | } 730 | } 731 | } 732 | } 733 | 734 | } 735 | 736 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 737 | public sealed partial class Payload : pb::IMessage { 738 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); 739 | public static pb::MessageParser Parser { get { return _parser; } } 740 | 741 | public static pbr::MessageDescriptor Descriptor { 742 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Descriptor.NestedTypes[2]; } 743 | } 744 | 745 | pbr::MessageDescriptor pb::IMessage.Descriptor { 746 | get { return Descriptor; } 747 | } 748 | 749 | public Payload() { 750 | OnConstruction(); 751 | } 752 | 753 | partial void OnConstruction(); 754 | 755 | public Payload(Payload other) : this() { 756 | result_ = other.result_; 757 | items_ = other.items_.Clone(); 758 | gemsAwarded_ = other.gemsAwarded_; 759 | eggPokemon_ = other.eggPokemon_; 760 | xpAwarded_ = other.xpAwarded_; 761 | cooldownComplete_ = other.cooldownComplete_; 762 | chainHackSequenceNumber_ = other.chainHackSequenceNumber_; 763 | } 764 | 765 | public Payload Clone() { 766 | return new Payload(this); 767 | } 768 | 769 | /// Field number for the "Result" field. 770 | public const int ResultFieldNumber = 1; 771 | private int result_; 772 | public int Result { 773 | get { return result_; } 774 | set { 775 | result_ = value; 776 | } 777 | } 778 | 779 | /// Field number for the "Items" field. 780 | public const int ItemsFieldNumber = 2; 781 | private static readonly pb::FieldCodec _repeated_items_codec 782 | = pb::FieldCodec.ForMessage(18, global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Types.Item.Parser); 783 | private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); 784 | public pbc::RepeatedField Items { 785 | get { return items_; } 786 | } 787 | 788 | /// Field number for the "GemsAwarded" field. 789 | public const int GemsAwardedFieldNumber = 3; 790 | private int gemsAwarded_; 791 | public int GemsAwarded { 792 | get { return gemsAwarded_; } 793 | set { 794 | gemsAwarded_ = value; 795 | } 796 | } 797 | 798 | /// Field number for the "EggPokemon" field. 799 | public const int EggPokemonFieldNumber = 4; 800 | private int eggPokemon_; 801 | public int EggPokemon { 802 | get { return eggPokemon_; } 803 | set { 804 | eggPokemon_ = value; 805 | } 806 | } 807 | 808 | /// Field number for the "XpAwarded" field. 809 | public const int XpAwardedFieldNumber = 5; 810 | private int xpAwarded_; 811 | public int XpAwarded { 812 | get { return xpAwarded_; } 813 | set { 814 | xpAwarded_ = value; 815 | } 816 | } 817 | 818 | /// Field number for the "CooldownComplete" field. 819 | public const int CooldownCompleteFieldNumber = 6; 820 | private long cooldownComplete_; 821 | public long CooldownComplete { 822 | get { return cooldownComplete_; } 823 | set { 824 | cooldownComplete_ = value; 825 | } 826 | } 827 | 828 | /// Field number for the "ChainHackSequenceNumber" field. 829 | public const int ChainHackSequenceNumberFieldNumber = 7; 830 | private int chainHackSequenceNumber_; 831 | public int ChainHackSequenceNumber { 832 | get { return chainHackSequenceNumber_; } 833 | set { 834 | chainHackSequenceNumber_ = value; 835 | } 836 | } 837 | 838 | public override bool Equals(object other) { 839 | return Equals(other as Payload); 840 | } 841 | 842 | public bool Equals(Payload other) { 843 | if (ReferenceEquals(other, null)) { 844 | return false; 845 | } 846 | if (ReferenceEquals(other, this)) { 847 | return true; 848 | } 849 | if (Result != other.Result) return false; 850 | if(!items_.Equals(other.items_)) return false; 851 | if (GemsAwarded != other.GemsAwarded) return false; 852 | if (EggPokemon != other.EggPokemon) return false; 853 | if (XpAwarded != other.XpAwarded) return false; 854 | if (CooldownComplete != other.CooldownComplete) return false; 855 | if (ChainHackSequenceNumber != other.ChainHackSequenceNumber) return false; 856 | return true; 857 | } 858 | 859 | public override int GetHashCode() { 860 | int hash = 1; 861 | if (Result != 0) hash ^= Result.GetHashCode(); 862 | hash ^= items_.GetHashCode(); 863 | if (GemsAwarded != 0) hash ^= GemsAwarded.GetHashCode(); 864 | if (EggPokemon != 0) hash ^= EggPokemon.GetHashCode(); 865 | if (XpAwarded != 0) hash ^= XpAwarded.GetHashCode(); 866 | if (CooldownComplete != 0L) hash ^= CooldownComplete.GetHashCode(); 867 | if (ChainHackSequenceNumber != 0) hash ^= ChainHackSequenceNumber.GetHashCode(); 868 | return hash; 869 | } 870 | 871 | public override string ToString() { 872 | return pb::JsonFormatter.ToDiagnosticString(this); 873 | } 874 | 875 | public void WriteTo(pb::CodedOutputStream output) { 876 | if (Result != 0) { 877 | output.WriteRawTag(8); 878 | output.WriteInt32(Result); 879 | } 880 | items_.WriteTo(output, _repeated_items_codec); 881 | if (GemsAwarded != 0) { 882 | output.WriteRawTag(24); 883 | output.WriteInt32(GemsAwarded); 884 | } 885 | if (EggPokemon != 0) { 886 | output.WriteRawTag(32); 887 | output.WriteInt32(EggPokemon); 888 | } 889 | if (XpAwarded != 0) { 890 | output.WriteRawTag(40); 891 | output.WriteInt32(XpAwarded); 892 | } 893 | if (CooldownComplete != 0L) { 894 | output.WriteRawTag(48); 895 | output.WriteInt64(CooldownComplete); 896 | } 897 | if (ChainHackSequenceNumber != 0) { 898 | output.WriteRawTag(56); 899 | output.WriteInt32(ChainHackSequenceNumber); 900 | } 901 | } 902 | 903 | public int CalculateSize() { 904 | int size = 0; 905 | if (Result != 0) { 906 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Result); 907 | } 908 | size += items_.CalculateSize(_repeated_items_codec); 909 | if (GemsAwarded != 0) { 910 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(GemsAwarded); 911 | } 912 | if (EggPokemon != 0) { 913 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(EggPokemon); 914 | } 915 | if (XpAwarded != 0) { 916 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(XpAwarded); 917 | } 918 | if (CooldownComplete != 0L) { 919 | size += 1 + pb::CodedOutputStream.ComputeInt64Size(CooldownComplete); 920 | } 921 | if (ChainHackSequenceNumber != 0) { 922 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(ChainHackSequenceNumber); 923 | } 924 | return size; 925 | } 926 | 927 | public void MergeFrom(Payload other) { 928 | if (other == null) { 929 | return; 930 | } 931 | if (other.Result != 0) { 932 | Result = other.Result; 933 | } 934 | items_.Add(other.items_); 935 | if (other.GemsAwarded != 0) { 936 | GemsAwarded = other.GemsAwarded; 937 | } 938 | if (other.EggPokemon != 0) { 939 | EggPokemon = other.EggPokemon; 940 | } 941 | if (other.XpAwarded != 0) { 942 | XpAwarded = other.XpAwarded; 943 | } 944 | if (other.CooldownComplete != 0L) { 945 | CooldownComplete = other.CooldownComplete; 946 | } 947 | if (other.ChainHackSequenceNumber != 0) { 948 | ChainHackSequenceNumber = other.ChainHackSequenceNumber; 949 | } 950 | } 951 | 952 | public void MergeFrom(pb::CodedInputStream input) { 953 | uint tag; 954 | while ((tag = input.ReadTag()) != 0) { 955 | switch(tag) { 956 | default: 957 | input.SkipLastField(); 958 | break; 959 | case 8: { 960 | Result = input.ReadInt32(); 961 | break; 962 | } 963 | case 18: { 964 | items_.AddEntriesFrom(input, _repeated_items_codec); 965 | break; 966 | } 967 | case 24: { 968 | GemsAwarded = input.ReadInt32(); 969 | break; 970 | } 971 | case 32: { 972 | EggPokemon = input.ReadInt32(); 973 | break; 974 | } 975 | case 40: { 976 | XpAwarded = input.ReadInt32(); 977 | break; 978 | } 979 | case 48: { 980 | CooldownComplete = input.ReadInt64(); 981 | break; 982 | } 983 | case 56: { 984 | ChainHackSequenceNumber = input.ReadInt32(); 985 | break; 986 | } 987 | } 988 | } 989 | } 990 | 991 | } 992 | 993 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 994 | public sealed partial class Item : pb::IMessage { 995 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Item()); 996 | public static pb::MessageParser Parser { get { return _parser; } } 997 | 998 | public static pbr::MessageDescriptor Descriptor { 999 | get { return global::PokemonGo.RocketAPI.GeneratedCode.FortSearchResponse.Descriptor.NestedTypes[3]; } 1000 | } 1001 | 1002 | pbr::MessageDescriptor pb::IMessage.Descriptor { 1003 | get { return Descriptor; } 1004 | } 1005 | 1006 | public Item() { 1007 | OnConstruction(); 1008 | } 1009 | 1010 | partial void OnConstruction(); 1011 | 1012 | public Item(Item other) : this() { 1013 | item_ = other.item_; 1014 | itemCount_ = other.itemCount_; 1015 | } 1016 | 1017 | public Item Clone() { 1018 | return new Item(this); 1019 | } 1020 | 1021 | /// Field number for the "Item" field. 1022 | public const int Item_FieldNumber = 1; 1023 | private int item_; 1024 | public int Item_ { 1025 | get { return item_; } 1026 | set { 1027 | item_ = value; 1028 | } 1029 | } 1030 | 1031 | /// Field number for the "ItemCount" field. 1032 | public const int ItemCountFieldNumber = 2; 1033 | private int itemCount_; 1034 | public int ItemCount { 1035 | get { return itemCount_; } 1036 | set { 1037 | itemCount_ = value; 1038 | } 1039 | } 1040 | 1041 | public override bool Equals(object other) { 1042 | return Equals(other as Item); 1043 | } 1044 | 1045 | public bool Equals(Item other) { 1046 | if (ReferenceEquals(other, null)) { 1047 | return false; 1048 | } 1049 | if (ReferenceEquals(other, this)) { 1050 | return true; 1051 | } 1052 | if (Item_ != other.Item_) return false; 1053 | if (ItemCount != other.ItemCount) return false; 1054 | return true; 1055 | } 1056 | 1057 | public override int GetHashCode() { 1058 | int hash = 1; 1059 | if (Item_ != 0) hash ^= Item_.GetHashCode(); 1060 | if (ItemCount != 0) hash ^= ItemCount.GetHashCode(); 1061 | return hash; 1062 | } 1063 | 1064 | public override string ToString() { 1065 | return pb::JsonFormatter.ToDiagnosticString(this); 1066 | } 1067 | 1068 | public void WriteTo(pb::CodedOutputStream output) { 1069 | if (Item_ != 0) { 1070 | output.WriteRawTag(8); 1071 | output.WriteInt32(Item_); 1072 | } 1073 | if (ItemCount != 0) { 1074 | output.WriteRawTag(16); 1075 | output.WriteInt32(ItemCount); 1076 | } 1077 | } 1078 | 1079 | public int CalculateSize() { 1080 | int size = 0; 1081 | if (Item_ != 0) { 1082 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item_); 1083 | } 1084 | if (ItemCount != 0) { 1085 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(ItemCount); 1086 | } 1087 | return size; 1088 | } 1089 | 1090 | public void MergeFrom(Item other) { 1091 | if (other == null) { 1092 | return; 1093 | } 1094 | if (other.Item_ != 0) { 1095 | Item_ = other.Item_; 1096 | } 1097 | if (other.ItemCount != 0) { 1098 | ItemCount = other.ItemCount; 1099 | } 1100 | } 1101 | 1102 | public void MergeFrom(pb::CodedInputStream input) { 1103 | uint tag; 1104 | while ((tag = input.ReadTag()) != 0) { 1105 | switch(tag) { 1106 | default: 1107 | input.SkipLastField(); 1108 | break; 1109 | case 8: { 1110 | Item_ = input.ReadInt32(); 1111 | break; 1112 | } 1113 | case 16: { 1114 | ItemCount = input.ReadInt32(); 1115 | break; 1116 | } 1117 | } 1118 | } 1119 | } 1120 | 1121 | } 1122 | 1123 | } 1124 | #endregion 1125 | 1126 | } 1127 | 1128 | #endregion 1129 | 1130 | } 1131 | 1132 | #endregion Designer generated code 1133 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/GeneratedCode/PlayerUpdateResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: PlayerUpdateResponse.proto 3 | #pragma warning disable 1591, 0612, 3021 4 | #region Designer generated code 5 | 6 | using pb = global::Google.Protobuf; 7 | using pbc = global::Google.Protobuf.Collections; 8 | using pbr = global::Google.Protobuf.Reflection; 9 | using scg = global::System.Collections.Generic; 10 | namespace PokemonGo.RocketAPI.GeneratedCode { 11 | 12 | /// Holder for reflection information generated from PlayerUpdateResponse.proto 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 | public static partial class PlayerUpdateResponseReflection { 15 | 16 | #region Descriptor 17 | /// File descriptor for PlayerUpdateResponse.proto 18 | public static pbr::FileDescriptor Descriptor { 19 | get { return descriptor; } 20 | } 21 | private static pbr::FileDescriptor descriptor; 22 | 23 | static PlayerUpdateResponseReflection() { 24 | byte[] descriptorData = global::System.Convert.FromBase64String( 25 | string.Concat( 26 | "ChpQbGF5ZXJVcGRhdGVSZXNwb25zZS5wcm90bxIhUG9rZW1vbkdvLlJvY2tl", 27 | "dEFQSS5HZW5lcmF0ZWRDb2RlIk4KFFBsYXllclVwZGF0ZVJlc3BvbnNlEhMK", 28 | "C1dpbGRQb2tlbW9uGAEgASgFEgwKBEZvcnQYAiABKAUSEwoLRm9ydHNOZWFy", 29 | "YnkYAyABKAViBnByb3RvMw==")); 30 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 31 | new pbr::FileDescriptor[] { }, 32 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 33 | new pbr::GeneratedClrTypeInfo(typeof(global::PokemonGo.RocketAPI.GeneratedCode.PlayerUpdateResponse), global::PokemonGo.RocketAPI.GeneratedCode.PlayerUpdateResponse.Parser, new[]{ "WildPokemon", "Fort", "FortsNearby" }, null, null, null) 34 | })); 35 | } 36 | #endregion 37 | 38 | } 39 | #region Messages 40 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 41 | public sealed partial class PlayerUpdateResponse : pb::IMessage { 42 | private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlayerUpdateResponse()); 43 | public static pb::MessageParser Parser { get { return _parser; } } 44 | 45 | public static pbr::MessageDescriptor Descriptor { 46 | get { return global::PokemonGo.RocketAPI.GeneratedCode.PlayerUpdateResponseReflection.Descriptor.MessageTypes[0]; } 47 | } 48 | 49 | pbr::MessageDescriptor pb::IMessage.Descriptor { 50 | get { return Descriptor; } 51 | } 52 | 53 | public PlayerUpdateResponse() { 54 | OnConstruction(); 55 | } 56 | 57 | partial void OnConstruction(); 58 | 59 | public PlayerUpdateResponse(PlayerUpdateResponse other) : this() { 60 | wildPokemon_ = other.wildPokemon_; 61 | fort_ = other.fort_; 62 | fortsNearby_ = other.fortsNearby_; 63 | } 64 | 65 | public PlayerUpdateResponse Clone() { 66 | return new PlayerUpdateResponse(this); 67 | } 68 | 69 | /// Field number for the "WildPokemon" field. 70 | public const int WildPokemonFieldNumber = 1; 71 | private int wildPokemon_; 72 | public int WildPokemon { 73 | get { return wildPokemon_; } 74 | set { 75 | wildPokemon_ = value; 76 | } 77 | } 78 | 79 | /// Field number for the "Fort" field. 80 | public const int FortFieldNumber = 2; 81 | private int fort_; 82 | public int Fort { 83 | get { return fort_; } 84 | set { 85 | fort_ = value; 86 | } 87 | } 88 | 89 | /// Field number for the "FortsNearby" field. 90 | public const int FortsNearbyFieldNumber = 3; 91 | private int fortsNearby_; 92 | public int FortsNearby { 93 | get { return fortsNearby_; } 94 | set { 95 | fortsNearby_ = value; 96 | } 97 | } 98 | 99 | public override bool Equals(object other) { 100 | return Equals(other as PlayerUpdateResponse); 101 | } 102 | 103 | public bool Equals(PlayerUpdateResponse other) { 104 | if (ReferenceEquals(other, null)) { 105 | return false; 106 | } 107 | if (ReferenceEquals(other, this)) { 108 | return true; 109 | } 110 | if (WildPokemon != other.WildPokemon) return false; 111 | if (Fort != other.Fort) return false; 112 | if (FortsNearby != other.FortsNearby) return false; 113 | return true; 114 | } 115 | 116 | public override int GetHashCode() { 117 | int hash = 1; 118 | if (WildPokemon != 0) hash ^= WildPokemon.GetHashCode(); 119 | if (Fort != 0) hash ^= Fort.GetHashCode(); 120 | if (FortsNearby != 0) hash ^= FortsNearby.GetHashCode(); 121 | return hash; 122 | } 123 | 124 | public override string ToString() { 125 | return pb::JsonFormatter.ToDiagnosticString(this); 126 | } 127 | 128 | public void WriteTo(pb::CodedOutputStream output) { 129 | if (WildPokemon != 0) { 130 | output.WriteRawTag(8); 131 | output.WriteInt32(WildPokemon); 132 | } 133 | if (Fort != 0) { 134 | output.WriteRawTag(16); 135 | output.WriteInt32(Fort); 136 | } 137 | if (FortsNearby != 0) { 138 | output.WriteRawTag(24); 139 | output.WriteInt32(FortsNearby); 140 | } 141 | } 142 | 143 | public int CalculateSize() { 144 | int size = 0; 145 | if (WildPokemon != 0) { 146 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(WildPokemon); 147 | } 148 | if (Fort != 0) { 149 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Fort); 150 | } 151 | if (FortsNearby != 0) { 152 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(FortsNearby); 153 | } 154 | return size; 155 | } 156 | 157 | public void MergeFrom(PlayerUpdateResponse other) { 158 | if (other == null) { 159 | return; 160 | } 161 | if (other.WildPokemon != 0) { 162 | WildPokemon = other.WildPokemon; 163 | } 164 | if (other.Fort != 0) { 165 | Fort = other.Fort; 166 | } 167 | if (other.FortsNearby != 0) { 168 | FortsNearby = other.FortsNearby; 169 | } 170 | } 171 | 172 | public void MergeFrom(pb::CodedInputStream input) { 173 | uint tag; 174 | while ((tag = input.ReadTag()) != 0) { 175 | switch(tag) { 176 | default: 177 | input.SkipLastField(); 178 | break; 179 | case 8: { 180 | WildPokemon = input.ReadInt32(); 181 | break; 182 | } 183 | case 16: { 184 | Fort = input.ReadInt32(); 185 | break; 186 | } 187 | case 24: { 188 | FortsNearby = input.ReadInt32(); 189 | break; 190 | } 191 | } 192 | } 193 | } 194 | 195 | } 196 | 197 | #endregion 198 | 199 | } 200 | 201 | #endregion Designer generated code 202 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/JsonHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json.Linq; 7 | 8 | namespace PokemonGo.RocketAPI.Helpers 9 | { 10 | public class JsonHelper 11 | { 12 | public static string GetValue(string json, string key) 13 | { 14 | var jObject = JObject.Parse(json); 15 | return jObject[key].ToString(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/ProtoHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Google.Protobuf; 8 | 9 | namespace PokemonGo.RocketAPI.Helpers 10 | { 11 | public class ProtoHelper 12 | { 13 | public static byte[] EncodeUlongList(List integers) 14 | { 15 | var output = new List(); 16 | foreach (var integer in integers.OrderBy(c => c)) 17 | { 18 | output.AddRange(VarintBitConverter.GetVarintBytes(integer)); 19 | } 20 | 21 | return output.ToArray(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/RandomHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.Helpers 8 | { 9 | public class RandomHelper 10 | { 11 | private static Random _random = new Random(); 12 | 13 | public static long GetLongRandom(long min, long max) 14 | { 15 | byte[] buf = new byte[8]; 16 | _random.NextBytes(buf); 17 | var longRand = BitConverter.ToInt64(buf, 0); 18 | 19 | return (Math.Abs(longRand % (max - min)) + min); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/RequestBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Google.Protobuf; 8 | using PokemonGo.RocketAPI.Enums; 9 | using PokemonGo.RocketAPI.Extensions; 10 | using PokemonGo.RocketAPI.GeneratedCode; 11 | using PokemonGo.RocketAPI.Helpers; 12 | 13 | namespace PokemonGo.RocketAPI.Helpers 14 | { 15 | public static class RequestBuilder 16 | { 17 | public static Request GetInitialRequest(string authToken, AuthType authType, double lat, double lng, double altitude, params Request.Types.Requests[] customRequests) 18 | { 19 | return new Request() 20 | { 21 | Altitude = Utils.FloatAsUlong(altitude), 22 | Auth = new Request.Types.AuthInfo() 23 | { 24 | Provider = authType == AuthType.Google ? "google" : "ptc", 25 | Token = new Request.Types.AuthInfo.Types.JWT() 26 | { 27 | Contents = authToken, 28 | Unknown13 = 14 29 | } 30 | }, 31 | Latitude = Utils.FloatAsUlong(lat), 32 | Longitude = Utils.FloatAsUlong(lng), 33 | RpcId = 1469378659230941192, 34 | Unknown1 = 2, 35 | Unknown12 = 989, //Required otherwise we receive incompatible protocol 36 | Requests = 37 | { 38 | customRequests 39 | } 40 | }; 41 | } 42 | 43 | public static Request GetInitialRequest(string authToken, AuthType authType, double lat, double lng, 44 | double altitude, params RequestType[] customRequestTypes) 45 | { 46 | var customRequests = customRequestTypes.ToList().Select(c => new Request.Types.Requests() {Type = (int) c}); 47 | return GetInitialRequest(authToken, authType, lat, lng, altitude, customRequests.ToArray()); 48 | } 49 | 50 | public static Request GetRequest(Request.Types.UnknownAuth unknownAuth, double lat, double lng, double altitude, params Request.Types.Requests[] customRequests) 51 | { 52 | return new Request() 53 | { 54 | Altitude = Utils.FloatAsUlong(altitude), 55 | Unknownauth = unknownAuth, 56 | Latitude = Utils.FloatAsUlong(lat), 57 | Longitude = Utils.FloatAsUlong(lng), 58 | RpcId = 1469378659230941192, 59 | Unknown1 = 2, 60 | Unknown12 = 989, //Required otherwise we receive incompatible protocol 61 | Requests = 62 | { 63 | customRequests 64 | } 65 | }; 66 | } 67 | 68 | public static Request GetRequest(Request.Types.UnknownAuth unknownAuth, double lat, double lng, double altitude, params RequestType[] customRequestTypes) 69 | { 70 | var customRequests = customRequestTypes.ToList().Select(c => new Request.Types.Requests() { Type = (int)c }); 71 | return GetRequest(unknownAuth, lat, lng, altitude, customRequests.ToArray()); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/RetryHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace PokemonGo.RocketAPI.Helpers 10 | { 11 | class RetryHandler : DelegatingHandler 12 | { 13 | private const int MaxRetries = 10; 14 | 15 | public RetryHandler(HttpMessageHandler innerHandler) 16 | : base(innerHandler) 17 | { } 18 | 19 | protected override async Task SendAsync( 20 | HttpRequestMessage request, 21 | CancellationToken cancellationToken) 22 | { 23 | for (int i = 0; i <= MaxRetries; i++) 24 | { 25 | try 26 | { 27 | return await base.SendAsync(request, cancellationToken); 28 | } 29 | catch (Exception ex) 30 | { 31 | if (i < MaxRetries) 32 | { 33 | await Task.Delay(2000); 34 | continue; 35 | } 36 | throw; 37 | } 38 | } 39 | return null; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/S2Helper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Google.Common.Geometry; 4 | 5 | namespace PokemonGo.RocketAPI.Helpers 6 | { 7 | public class S2Helper 8 | { 9 | public static List GetNearbyCellIds(double longitude, double latitude) 10 | { 11 | var nearbyCellIds = new List(); 12 | 13 | var cellId = S2CellId.FromLatLng(S2LatLng.FromDegrees(latitude, longitude)).ParentForLevel(15);//.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent; 14 | 15 | nearbyCellIds.Add(cellId); 16 | for (int i = 0; i < 10; i++) 17 | { 18 | nearbyCellIds.Add(GetPrevious(cellId, i)); 19 | nearbyCellIds.Add(GetNext(cellId, i)); 20 | } 21 | 22 | return nearbyCellIds.Select(c => c.Id).OrderBy(c => c).ToList(); 23 | } 24 | 25 | private static S2CellId GetPrevious(S2CellId cellId, int depth) 26 | { 27 | if (depth < 0) 28 | return cellId; 29 | 30 | depth--; 31 | 32 | return GetPrevious(cellId.Previous, depth); 33 | } 34 | 35 | private static S2CellId GetNext(S2CellId cellId, int depth) 36 | { 37 | if (depth < 0) 38 | return cellId; 39 | 40 | depth--; 41 | 42 | return GetNext(cellId.Next, depth); 43 | } 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Helpers/Utils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI.Helpers 8 | { 9 | public class Utils 10 | { 11 | public static ulong FloatAsUlong(double value) 12 | { 13 | var bytes = BitConverter.GetBytes(value); 14 | return BitConverter.ToUInt64(bytes, 0); 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/PokemonGo.RocketAPI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {05D2DA44-1B8E-4CF7-94ED-4D52451CD095} 8 | Library 9 | Properties 10 | PokemonGo.RocketAPI 11 | Pokemon Go Rocket API 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\..\packages\C5.2.2.5073.27396\lib\portable-net40+sl50+wp80+win\C5.dll 35 | True 36 | 37 | 38 | packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll 39 | True 40 | 41 | 42 | ..\packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8\Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.dll 43 | True 44 | 45 | 46 | ..\packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45\Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.Data.dll 47 | True 48 | 49 | 50 | ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll 51 | True 52 | 53 | 54 | ..\..\packages\S2Geometry.1.0.1\lib\portable-net45+wp8+win8\S2Geometry.dll 55 | True 56 | 57 | 58 | 59 | 60 | 61 | ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 62 | True 63 | 64 | 65 | ..\..\packages\VarintBitConverter.1.0.0.0\lib\Net40\System.VarintBitConverter.dll 66 | True 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Pokemon Go Rocket API")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Pokemon Go Rocket API")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("05d2da44-1b8e-4cf7-94ed-4d52451cd095")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/CatchPokemonResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message CatchPokemonResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | int32 Status = 1; 32 | int32 MissPercent = 2; 33 | int32 CapturedPokemonId = 3; 34 | int32 Scores = 4; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/EncounterResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message EncounterResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | int32 Pokemon = 1; 32 | int32 Background = 2; 33 | int32 Status = 3; 34 | int32 CaptureProbability = 4; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/FortDetailResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message FortDetailResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | string Id = 1; 32 | int32 Team = 2; 33 | int32 Pokemon = 3; 34 | string Name = 4; 35 | string ImageUrl = 5; 36 | int32 Fp = 6; 37 | int32 Stamina = 7; 38 | int32 MaxStamina = 8; 39 | int32 FortType = 9; 40 | int64 Latitude = 10; 41 | int64 Longitude = 11; 42 | string Description = 12; 43 | int32 Modifier = 13; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/FortSearchResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message FortSearchResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | int32 Result = 1; 32 | repeated Item Items = 2; 33 | int32 GemsAwarded = 3; 34 | int32 EggPokemon = 4; 35 | int32 XpAwarded = 5; 36 | int64 CooldownComplete = 6; 37 | int32 ChainHackSequenceNumber = 7; 38 | } 39 | 40 | message Item 41 | { 42 | int32 Item = 1; 43 | int32 ItemCount = 2; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/InventoryResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message InventoryResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | int32 Status = 1; 32 | InventoryResponseProto Bag = 2; 33 | } 34 | message InventoryResponseProto { 35 | int64 timestamp = 2; 36 | repeated InventoryItemResponseProto items = 3; 37 | 38 | message InventoryItemResponseProto { 39 | int64 timestamp = 1; 40 | InventoryItemProto item = 3; 41 | } 42 | } 43 | 44 | 45 | message InventoryItemProto { 46 | PokemonProto Pokemon = 1; 47 | ItemProto Item = 2; 48 | PokedexEntryProto PokedexEntry = 3; 49 | PlayerStatsProto PlayerStats = 4; 50 | PlayerCurrencyProto PlayerCurrency = 5; 51 | PlayerCameraProto PlayerCamera = 6; 52 | InventoryUpgradesProto InventoryUpgrades = 7; 53 | AppliedItemProto AppliedItem = 8; 54 | EggIncubatorProto EggIncubators = 9; 55 | PokemonFamilyProto PokemonFamily = 10; 56 | 57 | message ItemProto { 58 | int32 Item = 1; 59 | int32 Count = 2; 60 | bool Unseen = 3; 61 | } 62 | 63 | message PokedexEntryProto { 64 | int32 PokedexEntryNumber = 1; 65 | int32 TimesEncountered = 2; 66 | int32 TimesCaptured = 3; 67 | int32 EvolutionStonePieces = 4; 68 | int32 EvolutionStones = 5; 69 | } 70 | 71 | message PlayerStatsProto { 72 | int32 Level = 1; 73 | int64 Experience = 2; 74 | int64 PrevLevelExp = 3; 75 | int64 NextLevelExp = 4; 76 | float KmWalked = 5; 77 | int32 NumPokemonEncountered = 6; 78 | int32 NumUniquePokedexEntries = 7; 79 | int32 NumPokemonCaptured = 8; 80 | int32 NumEvolutions = 9; 81 | int32 PokeStopVisits = 10; 82 | int32 NumberOfPokeballThrown = 11; 83 | int32 NumEggsHatched = 12; 84 | int32 BigMagikarpCaught = 13; 85 | int32 NumBattleAttackWon = 14; 86 | int32 NumBattleAttackTotal = 15; 87 | int32 NumBattleDefendedWon = 16; 88 | int32 NumBattleTrainingWon = 17; 89 | int32 NumBattleTrainingTotal = 18; 90 | int32 PrestigeRaisedTotal = 19; 91 | int32 PrestigeDroppedTotal = 20; 92 | int32 NumPokemonDeployed = 21; 93 | int32 SmallRattataCaught = 23; 94 | } 95 | 96 | message AppliedItemProto { 97 | int32 Item = 1; 98 | int32 ItemType = 2; 99 | int64 ExpirationMs = 3; 100 | int64 AppliedMs = 4; 101 | } 102 | 103 | message PlayerCameraProto { 104 | bool DefaultCamera = 1; 105 | } 106 | 107 | 108 | message PlayerCurrencyProto { 109 | int32 Gems = 1; 110 | } 111 | 112 | message InventoryUpgradesProto { 113 | int32 InventoryUpgrade = 1; 114 | } 115 | 116 | message EggIncubatorProto { 117 | string ItemId = 1; 118 | ItemProto Item = 2; 119 | int32 IncubatorType = 3; 120 | int32 UsesRemaining = 4; 121 | int64 PokemonId = 5; 122 | double StartKmWalked = 6; 123 | double TargetKmWalked = 7; 124 | } 125 | 126 | message PokemonFamilyProto { 127 | int32 FamilyId = 1; 128 | int32 Candy = 2; 129 | } 130 | } 131 | 132 | // POKEMON TRANSFER 133 | message TransferPokemonProto { 134 | fixed64 PokemonId = 1; 135 | } 136 | 137 | message TransferPokemonOutProto { 138 | int32 Status = 1; 139 | int32 CandyAwarded = 2; 140 | } 141 | 142 | // EVOLVE 143 | message EvolvePokemonProto { 144 | fixed64 PokemonId = 1; 145 | } 146 | 147 | 148 | message EvolvePokemonOutProto { 149 | int32 Result = 1; 150 | PokemonProto EvolvedPokemon = 2; 151 | int32 ExpAwarded = 3; 152 | int32 CandyAwarded = 4; 153 | } 154 | 155 | message PokemonProto { 156 | int32 Id = 1; 157 | PokemonIds PokemonId = 2; 158 | int32 Cp = 3; 159 | int32 Stamina = 4; 160 | int32 MaxStamina = 5; 161 | int32 Move1 = 6; 162 | int32 Move2 = 7; 163 | int32 DeployedFortId = 8; 164 | int32 OwnerName = 9; 165 | int32 IsEgg = 10; 166 | int32 EggKmWalkedTarget = 11; 167 | int32 EggKmWalkedStart = 12; 168 | int32 Origin = 14; 169 | fixed32 HeightM = 15; 170 | fixed32 WeightKg = 16; 171 | int32 IndividualAttack = 17; 172 | int32 IndividualDefense = 18; 173 | int32 IndividualStamina = 19; 174 | fixed32 CpMultiplier = 20; 175 | int32 Pokeball = 21; 176 | fixed64 CapturedS2CellId = 22; 177 | int32 BattlesAttacked = 23; 178 | int32 BattlesDefended = 24; 179 | int32 EggIncubatorId = 25; 180 | int64 CreationTimeMs = 26; 181 | int32 NumUpgrades = 27; 182 | int32 AdditionalCpMultiplier = 28; 183 | int32 Favorite = 29; 184 | int32 Nickname = 30; 185 | int32 FromFort = 31; 186 | 187 | enum PokemonIds { 188 | POKEMON_UNSET = 0; 189 | V0001_POKEMON_BULBASAUR = 1; 190 | V0002_POKEMON_IVYSAUR = 2; 191 | V0003_POKEMON_VENUSAUR = 3; 192 | V0004_POKEMON_CHARMANDER = 4; 193 | V0005_POKEMON_CHARMELEON = 5; 194 | V0006_POKEMON_CHARIZARD = 6; 195 | V0007_POKEMON_SQUIRTLE = 7; 196 | V0008_POKEMON_WARTORTLE = 8; 197 | V0009_POKEMON_BLASTOISE = 9; 198 | V0010_POKEMON_CATERPIE = 10; 199 | V0011_POKEMON_METAPOD = 11; 200 | V0012_POKEMON_BUTTERFREE = 12; 201 | V0013_POKEMON_WEEDLE = 13; 202 | V0014_POKEMON_KAKUNA = 14; 203 | V0015_POKEMON_BEEDRILL = 15; 204 | V0016_POKEMON_PIDGEY = 16; 205 | V0017_POKEMON_PIDGEOTTO = 17; 206 | V0018_POKEMON_PIDGEOT = 18; 207 | V0019_POKEMON_RATTATA = 19; 208 | V0020_POKEMON_RATICATE = 20; 209 | V0021_POKEMON_SPEAROW = 21; 210 | V0022_POKEMON_FEAROW = 22; 211 | V0023_POKEMON_EKANS = 23; 212 | V0024_POKEMON_ARBOK = 24; 213 | V0025_POKEMON_PIKACHU = 25; 214 | V0026_POKEMON_RAICHU = 26; 215 | V0027_POKEMON_SANDSHREW = 27; 216 | V0028_POKEMON_SANDSLASH = 28; 217 | V0029_POKEMON_NIDORAN = 29; 218 | V0030_POKEMON_NIDORINA = 30; 219 | V0031_POKEMON_NIDOQUEEN = 31; 220 | V0032_POKEMON_NIDORAN = 32; 221 | V0033_POKEMON_NIDORINO = 33; 222 | V0034_POKEMON_NIDOKING = 34; 223 | V0035_POKEMON_CLEFAIRY = 35; 224 | V0036_POKEMON_CLEFABLE = 36; 225 | V0037_POKEMON_VULPIX = 37; 226 | V0038_POKEMON_NINETALES = 38; 227 | V0039_POKEMON_JIGGLYPUFF = 39; 228 | V0040_POKEMON_WIGGLYTUFF = 40; 229 | V0041_POKEMON_ZUBAT = 41; 230 | V0042_POKEMON_GOLBAT = 42; 231 | V0043_POKEMON_ODDISH = 43; 232 | V0044_POKEMON_GLOOM = 44; 233 | V0045_POKEMON_VILEPLUME = 45; 234 | V0046_POKEMON_PARAS = 46; 235 | V0047_POKEMON_PARASECT = 47; 236 | V0048_POKEMON_VENONAT = 48; 237 | V0049_POKEMON_VENOMOTH = 49; 238 | V0050_POKEMON_DIGLETT = 50; 239 | V0051_POKEMON_DUGTRIO = 51; 240 | V0052_POKEMON_MEOWTH = 52; 241 | V0053_POKEMON_PERSIAN = 53; 242 | V0054_POKEMON_PSYDUCK = 54; 243 | V0055_POKEMON_GOLDUCK = 55; 244 | V0056_POKEMON_MANKEY = 56; 245 | V0057_POKEMON_PRIMEAPE = 57; 246 | V0058_POKEMON_GROWLITHE = 58; 247 | V0059_POKEMON_ARCANINE = 59; 248 | V0060_POKEMON_POLIWAG = 60; 249 | V0061_POKEMON_POLIWHIRL = 61; 250 | V0062_POKEMON_POLIWRATH = 62; 251 | V0063_POKEMON_ABRA = 63; 252 | V0064_POKEMON_KADABRA = 64; 253 | V0065_POKEMON_ALAKAZAM = 65; 254 | V0066_POKEMON_MACHOP = 66; 255 | V0067_POKEMON_MACHOKE = 67; 256 | V0068_POKEMON_MACHAMP = 68; 257 | V0069_POKEMON_BELLSPROUT = 69; 258 | V0070_POKEMON_WEEPINBELL = 70; 259 | V0071_POKEMON_VICTREEBEL = 71; 260 | V0072_POKEMON_TENTACOOL = 72; 261 | V0073_POKEMON_TENTACRUEL = 73; 262 | V0074_POKEMON_GEODUDE = 74; 263 | V0075_POKEMON_GRAVELER = 75; 264 | V0076_POKEMON_GOLEM = 76; 265 | V0077_POKEMON_PONYTA = 77; 266 | V0078_POKEMON_RAPIDASH = 78; 267 | V0079_POKEMON_SLOWPOKE = 79; 268 | V0080_POKEMON_SLOWBRO = 80; 269 | V0081_POKEMON_MAGNEMITE = 81; 270 | V0082_POKEMON_MAGNETON = 82; 271 | V0083_POKEMON_FARFETCHD = 83; 272 | V0084_POKEMON_DODUO = 84; 273 | V0085_POKEMON_DODRIO = 85; 274 | V0086_POKEMON_SEEL = 86; 275 | V0087_POKEMON_DEWGONG = 87; 276 | V0088_POKEMON_GRIMER = 88; 277 | V0089_POKEMON_MUK = 89; 278 | V0090_POKEMON_SHELLDER = 90; 279 | V0091_POKEMON_CLOYSTER = 91; 280 | V0092_POKEMON_GASTLY = 92; 281 | V0093_POKEMON_HAUNTER = 93; 282 | V0094_POKEMON_GENGAR = 94; 283 | V0095_POKEMON_ONIX = 95; 284 | V0096_POKEMON_DROWZEE = 96; 285 | V0097_POKEMON_HYPNO = 97; 286 | V0098_POKEMON_KRABBY = 98; 287 | V0099_POKEMON_KINGLER = 99; 288 | V0100_POKEMON_VOLTORB = 100; 289 | V0101_POKEMON_ELECTRODE = 101; 290 | V0102_POKEMON_EXEGGCUTE = 102; 291 | V0103_POKEMON_EXEGGUTOR = 103; 292 | V0104_POKEMON_CUBONE = 104; 293 | V0105_POKEMON_MAROWAK = 105; 294 | V0106_POKEMON_HITMONLEE = 106; 295 | V0107_POKEMON_HITMONCHAN = 107; 296 | V0108_POKEMON_LICKITUNG = 108; 297 | V0109_POKEMON_KOFFING = 109; 298 | V0110_POKEMON_WEEZING = 110; 299 | V0111_POKEMON_RHYHORN = 111; 300 | V0112_POKEMON_RHYDON = 112; 301 | V0113_POKEMON_CHANSEY = 113; 302 | V0114_POKEMON_TANGELA = 114; 303 | V0115_POKEMON_KANGASKHAN = 115; 304 | V0116_POKEMON_HORSEA = 116; 305 | V0117_POKEMON_SEADRA = 117; 306 | V0118_POKEMON_GOLDEEN = 118; 307 | V0119_POKEMON_SEAKING = 119; 308 | V0120_POKEMON_STARYU = 120; 309 | V0121_POKEMON_STARMIE = 121; 310 | V0122_POKEMON_MR_MIME = 122; 311 | V0123_POKEMON_SCYTHER = 123; 312 | V0124_POKEMON_JYNX = 124; 313 | V0125_POKEMON_ELECTABUZZ = 125; 314 | V0126_POKEMON_MAGMAR = 126; 315 | V0127_POKEMON_PINSIR = 127; 316 | V0128_POKEMON_TAUROS = 128; 317 | V0129_POKEMON_MAGIKARP = 129; 318 | V0130_POKEMON_GYARADOS = 130; 319 | V0131_POKEMON_LAPRAS = 131; 320 | V0132_POKEMON_DITTO = 132; 321 | V0133_POKEMON_EEVEE = 133; 322 | V0134_POKEMON_VAPOREON = 134; 323 | V0135_POKEMON_JOLTEON = 135; 324 | V0136_POKEMON_FLAREON = 136; 325 | V0137_POKEMON_PORYGON = 137; 326 | V0138_POKEMON_OMANYTE = 138; 327 | V0139_POKEMON_OMASTAR = 139; 328 | V0140_POKEMON_KABUTO = 140; 329 | V0141_POKEMON_KABUTOPS = 141; 330 | V0142_POKEMON_AERODACTYL = 142; 331 | V0143_POKEMON_SNORLAX = 143; 332 | V0144_POKEMON_ARTICUNO = 144; 333 | V0145_POKEMON_ZAPDOS = 145; 334 | V0146_POKEMON_MOLTRES = 146; 335 | V0147_POKEMON_DRATINI = 147; 336 | V0148_POKEMON_DRAGONAIR = 148; 337 | V0149_POKEMON_DRAGONITE = 149; 338 | V0150_POKEMON_MEWTWO = 150; 339 | V0151_POKEMON_MEW = 151; 340 | } 341 | } 342 | 343 | 344 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/MapObjectsResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message MapObjectsResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Unknown7 unknown7 = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Unknown7 { 25 | bytes unknown71 = 1; 26 | int64 unknown72 = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | repeated ClientMapCell profile = 1; 32 | int32 unknownnumber = 2; 33 | 34 | message ClientMapCell { 35 | uint64 S2CellId = 1; 36 | int64 AsOfTimeMs = 2; 37 | repeated PokemonFortProto Fort = 3; 38 | repeated ClientSpawnPointProto SpawnPoint = 4; 39 | repeated WildPokemonProto WildPokemon = 5; 40 | //unknown DeletedObject = 6; 41 | bool IsTruncatedList = 7; 42 | repeated PokemonSummaryFortProto FortSummary = 8; 43 | repeated ClientSpawnPointProto DecimatedSpawnPoint = 9; 44 | repeated MapPokemonProto MapPokemon = 10; 45 | repeated NearbyPokemonProto NearbyPokemon = 11; 46 | } 47 | 48 | 49 | message WildPokemon { 50 | string UniqueId = 1; 51 | string PokemonId = 2; 52 | // int64 three = 3; 53 | // float four = 4; 54 | // int32 five = 5; 55 | // unknown six = 6; 56 | repeated NearbyPokemonProto pokemon = 11; 57 | } 58 | 59 | 60 | message MapPokemonProto { 61 | string SpawnpointId = 1; 62 | fixed64 EncounterId = 2; 63 | int32 PokedexTypeId = 3; 64 | int64 ExpirationTimeMs = 4; 65 | double Latitude = 5; 66 | double Longitude = 6; 67 | } 68 | 69 | message PokemonFortProto { 70 | string FortId = 1; 71 | int64 LastModifiedMs = 2; 72 | double Latitude = 3; 73 | double Longitude = 4; 74 | int32 Team = 5; 75 | int32 GuardPokemonId = 6; 76 | int32 GuardPokemonLevel = 7; 77 | bool Enabled = 8; 78 | // ENUM.Holoholo.Rpc.FortType FortType = 9; 79 | int32 FortType = 9; 80 | int64 GymPoints = 10; 81 | bool IsInBattle = 11; 82 | //unknown ActiveFortModifier = 12; 83 | MapPokemonProto ActivePokemon = 13; 84 | int64 CooldownCompleteMs = 14; 85 | // ENUM.Holoholo.Rpc.Sponsor.Types.FortSponsor.Sponsor Sponsor = 15; 86 | int32 Sponsor = 15; 87 | // ENUM.Holoholo.Rpc.RenderingType.Types.FortRenderingType.RenderingType RenderingType = 16; 88 | int32 RenderingType = 16; 89 | } 90 | 91 | message PokemonSummaryFortProto { 92 | string FortSummaryId = 1; 93 | int64 LastModifiedMs = 2; 94 | double Latitude = 3; 95 | double Longitude = 4; 96 | } 97 | 98 | message ClientSpawnPointProto { 99 | double Latitude = 2; 100 | double Longitude = 3; 101 | } 102 | 103 | message WildPokemonProto { 104 | uint64 EncounterId = 1; 105 | int64 LastModifiedMs = 2; 106 | double Latitude = 3; 107 | double Longitude = 4; 108 | string SpawnPointId = 5; 109 | Pokemon pokemon = 7; 110 | int32 TimeTillHiddenMs = 11; 111 | 112 | message Pokemon { 113 | uint64 Id = 1; 114 | int32 PokemonId = 2; 115 | } 116 | } 117 | 118 | message NearbyPokemonProto { 119 | int32 PokedexNumber = 1; 120 | float DistanceMeters = 2; 121 | uint64 EncounterId = 3; 122 | } 123 | 124 | } 125 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/PlayerUpdateResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message PlayerUpdateResponse { 6 | int32 WildPokemon = 1; 7 | int32 Fort = 2; 8 | int32 FortsNearby = 3; 9 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/ProfileResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message ProfileResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Auth auth = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Auth { 25 | bytes unknown71 = 1; 26 | int64 timestamp = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | int32 unknown1 = 1; 32 | Profile profile = 2; 33 | bytes setting = 3; 34 | 35 | 36 | message Profile { 37 | int64 creation_time = 1; 38 | string username = 2; 39 | int32 team = 5; 40 | bytes tutorial = 7; 41 | AvatarDetails avatar = 8; 42 | int32 poke_storage = 9; 43 | int32 item_storage = 10; 44 | DailyBonus daily_bonus = 11; 45 | bytes unknown12 = 12; 46 | bytes unknown13 = 13; 47 | repeated Currency currency = 14; 48 | 49 | message AvatarDetails { 50 | int32 unknown2 = 2; 51 | int32 unknown3 = 3; 52 | int32 unknown9 = 9; 53 | int32 unknown10 = 10; 54 | } 55 | 56 | message DailyBonus { 57 | int64 NextCollectTimestampMs = 1; 58 | int64 NextDefenderBonusCollectTimestampMs = 2; 59 | } 60 | 61 | message Currency { 62 | string type = 1; 63 | int32 amount = 2; 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/Request.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message Request { 6 | int32 unknown1 = 1; 7 | int64 rpc_id = 3; 8 | repeated Requests requests = 4; 9 | Unknown6 unknown6 = 6; 10 | fixed64 latitude = 7; 11 | fixed64 longitude = 8; 12 | fixed64 altitude = 9; 13 | AuthInfo auth = 10; 14 | UnknownAuth unknownauth = 11; 15 | int64 unknown12 = 12; 16 | 17 | 18 | message UnknownAuth { 19 | bytes unknown71 = 1; 20 | int64 timestamp = 2; 21 | bytes unknown73 = 3; 22 | } 23 | 24 | message Requests { 25 | int32 type = 1; 26 | bytes message = 2; 27 | } 28 | 29 | message Unknown3 { 30 | string unknown4 = 1; 31 | } 32 | 33 | message Unknown6 { 34 | int32 unknown1 = 1; 35 | Unknown2 unknown2 = 2; 36 | 37 | message Unknown2 { 38 | bytes unknown1 = 1; 39 | } 40 | 41 | } 42 | 43 | message AuthInfo { 44 | string provider = 1; 45 | JWT token = 2; 46 | 47 | message JWT { 48 | string contents = 1; 49 | int32 unknown13 = 2; 50 | } 51 | } 52 | message PlayerUpdateProto { 53 | fixed64 Lat = 1; 54 | fixed64 Lng = 2; 55 | } 56 | 57 | message MapObjectsRequest 58 | { 59 | bytes cellIds = 1; 60 | bytes unknown14 = 2; 61 | fixed64 latitude = 3; 62 | fixed64 longitude = 4; 63 | } 64 | 65 | message FortSearchRequest 66 | { 67 | bytes Id = 1; 68 | fixed64 PlayerLatDegrees = 2; 69 | fixed64 PlayerLngDegrees = 3; 70 | fixed64 FortLatDegrees = 4; 71 | fixed64 FortLngDegrees = 5; 72 | } 73 | 74 | message FortDetailsRequest 75 | { 76 | bytes Id = 1; 77 | fixed64 Latitude = 2; 78 | fixed64 Longitude = 3; 79 | } 80 | 81 | message EncounterRequest { 82 | fixed64 EncounterId = 1; 83 | string SpawnpointId = 2; 84 | fixed64 PlayerLatDegrees = 3; 85 | fixed64 PlayerLngDegrees = 4; 86 | } 87 | 88 | message CatchPokemonRequest { 89 | fixed64 EncounterId = 1; 90 | int32 Pokeball = 2; 91 | fixed64 NormalizedReticleSize = 3; 92 | string SpawnPointGuid = 4; 93 | int32 HitPokemon = 5; 94 | fixed64 SpinModifier = 6; 95 | fixed64 NormalizedHitPosition = 7; 96 | } 97 | 98 | message SettingsGuid 99 | { 100 | bytes guid = 1; 101 | } 102 | 103 | message Time 104 | { 105 | int64 time = 1; 106 | } 107 | 108 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Proto/SettingsResponse.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package PokemonGo.RocketAPI.GeneratedCode; 4 | 5 | message SettingsResponse { 6 | int32 unknown1 = 1; 7 | int64 unknown2 = 2; 8 | string api_url = 3; 9 | Unknown6 unknown6 = 6; 10 | Auth auth = 7; 11 | repeated Payload payload = 100; 12 | string errorMessage = 101; //Should be moved to an error-proto file if error is always 101 field 13 | 14 | message Unknown6 { 15 | int32 unknown1 = 1; 16 | Unknown2 unknown2 = 2; 17 | 18 | message Unknown2 { 19 | bytes unknown1 = 1; 20 | } 21 | 22 | } 23 | 24 | message Auth { 25 | bytes unknown71 = 1; 26 | int64 timestamp = 2; 27 | bytes unknown73 = 3; 28 | } 29 | 30 | message Payload { 31 | string guid = 2; 32 | GlobalSettingsProto settings = 3; 33 | 34 | message GlobalSettingsProto { 35 | FortSettingsProto FortSettings = 2; 36 | MapSettingsProto MapSettings = 3; 37 | LevelSettingsProto LevelSettings = 4; 38 | InventorySettingsProto InventorySettings = 5; 39 | string MinimumClientVersion = 6; 40 | } 41 | message FortSettingsProto { 42 | double InteractionRangeMeters = 1; 43 | int32 MaxTotalDeployedPokemon = 2; 44 | int32 MaxPlayerDeployedPokemon = 3; 45 | double DeployStaminaMultiplier = 4; 46 | double DeployAttackMultiplier = 5; 47 | double FarInteractionRangeMeters = 6; 48 | } 49 | message MapSettingsProto { 50 | double PokemonVisibleRange = 1; 51 | double PokeNavRangeMeters = 2; 52 | double EncounterRangeMeters = 3; 53 | float GetMapObjectsMinRefreshSeconds = 4; 54 | float GetMapObjectsMaxRefreshSeconds = 5; 55 | float GetMapObjectsMinDistanceMeters = 6; 56 | string GoogleMapsApiKey = 7; 57 | } 58 | message LevelSettingsProto { 59 | double TrainerCpModifier = 2; 60 | double TrainerDifficultyModifier = 3; 61 | } 62 | message InventorySettingsProto { 63 | int32 MaxPokemon = 1; 64 | int32 MaxBagItems = 2; 65 | int32 BasePokemon = 3; 66 | int32 BaseBagItems = 4; 67 | int32 BaseEggs = 5; 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Resources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI 8 | { 9 | public class Resources 10 | { 11 | public const string RpcUrl = @"https://pgorelease.nianticlabs.com/plfe/rpc"; 12 | public const string NumberedRpcUrl = @"https://pgorelease.nianticlabs.com/plfe/{0}/rpc"; 13 | public const string PtcLoginUrl = "https://sso.pokemon.com/sso/login?service=https%3A%2F%2Fsso.pokemon.com%2Fsso%2Foauth2.0%2FcallbackAuthorize"; 14 | public const string PtcLoginOauth = "https://sso.pokemon.com/sso/oauth2.0/accessToken"; 15 | public const string GoogleGrantRefreshAccessUrl = "https://android.clients.google.com/auth"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PokemonGo.RocketAPI 8 | { 9 | public static class Settings 10 | { 11 | //Fetch these settings from intercepting the /auth call in headers and body (only needed for google auth) 12 | public const string DeviceId = "cool-device-id"; 13 | public const string Email = "fake@gmail.com"; 14 | public const string ClientSig = "fake"; 15 | public const string LongDurationToken = "fakeid"; 16 | public const double DefaultLatitude = 10; 17 | public const double DefaultLongitude = 10; 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PokemonGo/RocketAPI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pokemon-Go-Rocket-API 2 | 3 | # Pokemon Go Client API Library in C# # 4 | 5 | Example: 6 | 7 | ``` 8 | var client = new Client(Settings.DefaultLatitude, Settings.DefaultLongitude); 9 | 10 | await client.LoginPtc("FeroxRev", "Sekret"); 11 | //await client.LoginGoogle(Settings.DeviceId, Settings.Email, Settings.LongDurationToken); 12 | var serverResponse = await client.GetServer(); 13 | var profile = await client.GetProfile(); 14 | var settings = await client.GetSettings(); 15 | var mapObjects = await client.GetMapObjects(); 16 | var inventory = await client.GetInventory(); 17 | 18 | await ExecuteFarmingPokestops(client); 19 | await ExecuteCatchAllNearbyPokemons(client); 20 | ``` 21 | 22 | Features 23 | ``` 24 | #PTC Login / Google last part 25 | #Get Map Objects and Inventory 26 | #Search for gyms/pokestops/spawns 27 | #Farm pokestops 28 | #Farm all pokemons in neighbourhood 29 | ``` 30 | 31 | Todo 32 | 33 | ``` 34 | #Gotta catch them all 35 | #Map Enums 36 | ``` 37 | --------------------------------------------------------------------------------