diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 10:25:17 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 10:25:17 -0400 |
commit | 81b6679d3d2886f5608a09315fdc3b9d4f19f1fc (patch) | |
tree | fe62ed612e3cb23e74ba1a88c0ee2c86b98fc570 /source/main.c | |
parent | fff1871a51e72365db7b5856f0335cfd14a7c005 (diff) | |
download | gen3uploader-81b6679d3d2886f5608a09315fdc3b9d4f19f1fc.tar.gz gen3uploader-81b6679d3d2886f5608a09315fdc3b9d4f19f1fc.tar.bz2 gen3uploader-81b6679d3d2886f5608a09315fdc3b9d4f19f1fc.zip |
Added more data to the HTTP POST
Diffstat (limited to 'source/main.c')
-rw-r--r-- | source/main.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/source/main.c b/source/main.c index eb5072e..64e6cba 100644 --- a/source/main.c +++ b/source/main.c | |||
@@ -376,6 +376,36 @@ void* extractor(void* userdata) | |||
376 | "spDefense", | 376 | "spDefense", |
377 | __builtin_bswap32(pki->spDefense)); | 377 | __builtin_bswap32(pki->spDefense)); |
378 | 378 | ||
379 | cJSON_AddNumberToObject( | ||
380 | jPoke, | ||
381 | "coolness", | ||
382 | __builtin_bswap32(pki->cool)); | ||
383 | |||
384 | cJSON_AddNumberToObject( | ||
385 | jPoke, | ||
386 | "beauty", | ||
387 | __builtin_bswap32(pki->beauty)); | ||
388 | |||
389 | cJSON_AddNumberToObject( | ||
390 | jPoke, | ||
391 | "cuteness", | ||
392 | __builtin_bswap32(pki->cute)); | ||
393 | |||
394 | cJSON_AddNumberToObject( | ||
395 | jPoke, | ||
396 | "smartness", | ||
397 | __builtin_bswap32(pki->smart)); | ||
398 | |||
399 | cJSON_AddNumberToObject( | ||
400 | jPoke, | ||
401 | "toughness", | ||
402 | __builtin_bswap32(pki->tough)); | ||
403 | |||
404 | cJSON_AddNumberToObject( | ||
405 | jPoke, | ||
406 | "sheen", | ||
407 | __builtin_bswap32(pki->sheen)); | ||
408 | |||
379 | cJSON_AddItemToObject( | 409 | cJSON_AddItemToObject( |
380 | jPoke, | 410 | jPoke, |
381 | "key", | 411 | "key", |
@@ -437,10 +467,45 @@ void* extractor(void* userdata) | |||
437 | "metLocation", | 467 | "metLocation", |
438 | pki->metLocation); | 468 | pki->metLocation); |
439 | 469 | ||
470 | cJSON_AddBoolToObject( | ||
471 | jPoke, | ||
472 | "shiny", | ||
473 | pki->shiny); | ||
474 | |||
475 | cJSON_AddNumberToObject( | ||
476 | jPoke, | ||
477 | "nature", | ||
478 | pki->nature); | ||
479 | |||
480 | if (pki->gender == 0) | ||
481 | { | ||
482 | cJSON_AddStringToObject(jPoke, "gender", "male"); | ||
483 | } else if (pki->gender == 1) | ||
484 | { | ||
485 | cJSON_AddStringToObject(jPoke, "gender", "female"); | ||
486 | } else if (pki->gender == 2) | ||
487 | { | ||
488 | cJSON_AddStringToObject(jPoke, "gender", "genderless"); | ||
489 | } | ||
490 | |||
491 | cJSON_AddBoolToObject( | ||
492 | jPoke, | ||
493 | "secondAbility", | ||
494 | pki->altAbility); | ||
495 | |||
496 | // Handle Unown form. | ||
497 | if (pki->species == 201) | ||
498 | { | ||
499 | cJSON_AddNumberToObject( | ||
500 | jPoke, | ||
501 | "unownLetter", | ||
502 | pki->unownLetter); | ||
503 | } | ||
504 | |||
440 | cJSON_AddItemToArray(jParty, jPoke); | 505 | cJSON_AddItemToArray(jParty, jPoke); |
441 | } | 506 | } |
442 | 507 | ||
443 | cJSON_AddItemToObject(root, "party", jParty); | 508 | cJSON_AddItemToObject(root, "pokemon", jParty); |
444 | 509 | ||
445 | char *rendered = cJSON_Print(root); | 510 | char *rendered = cJSON_Print(root); |
446 | printf("%s\n", rendered); | 511 | printf("%s\n", rendered); |