dd_gamejolt.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef DD_GAMEJOLT_H
  2. #define DD_GAMEJOLT_H
  3. //
  4. //#include "dd_json.h"
  5. //
  6. //// base URL
  7. //#define DD_GAMEJOLT_BASE "https://api.gamejolt.com/api/game/v1_2/"
  8. //
  9. //// Scores functionality
  10. //#define DD_GAMEJOLT_SCORES DD_GAMEJOLT_BASE "scores/"
  11. //
  12. //#define DD_GAMEJOLT_SCORES_ADD DD_GAMEJOLT_SCORES "add/"
  13. //#define DD_GAMEJOLT_SCORES_GETRANK DD_GAMEJOLT_SCORES "get-rank/"
  14. //#define DD_GAMEJOLT_SCORES_FETCH DD_GAMEJOLT_SCORES ""
  15. //#define DD_GAMEJOLT_SCORES_GETTABLES DD_GAMEJOLT_SCORES "tables/"
  16. //
  17. //#define DD_GAMEJOLT_SCORES_FETCH_BETTER_THAN 1
  18. //#define DD_GAMEJOLT_SCORES_FETCH_WORSE_THAN 2
  19. //#define DD_GAMEJOLT_SCORES_FETCH_BETTER_WORSE 3
  20. //
  21. ///*
  22. // * Pass the game's secret key to activate gamejolt features for that game
  23. // * Passing `0` will deactivate it.
  24. // *
  25. // */
  26. //void dd_gamejolt_activate(char *localGameKey, char *localGameId);
  27. //int dd_gamejolt_isActive();
  28. //
  29. ///*
  30. // * Handling user
  31. // */
  32. //void dd_gamejolt_userSet(char *username, char *user_token);
  33. //void dd_gamejolt_guestSet();
  34. //void dd_gamejolt_customGuestSet(char *guestname);
  35. //
  36. //char *dd_gamejolt_getGuestname();
  37. //char *dd_gamejolt_getUsername();
  38. //char *dd_gamejolt_getUsertoken();
  39. //char *dd_gamejolt_getName();
  40. //int dd_gamejolt_hasUser();
  41. //
  42. //extern struct dd_gamejolt_response_score {
  43. // char score[20];
  44. // int sort;
  45. // char user[20];
  46. // int user_id;
  47. // char guest[20];
  48. // char stored[100];
  49. // int stored_timestamp;
  50. //} x;
  51. //
  52. ///*
  53. // * response handling
  54. // */
  55. //extern struct dd_gamejolt_response_struct {
  56. // int success;
  57. // char message[DD_JSON_BUFFER_SIZE];
  58. // int rank;
  59. // struct dd_gamejolt_response_score scores[10];
  60. // int scoreCount;
  61. //
  62. //} structReturnData;
  63. //
  64. //void dd_gamejolt_response_struct_create(struct dd_gamejolt_response_struct *);
  65. //
  66. ///*
  67. // * Add score to a table
  68. // *
  69. // * Calling `setTableId` will set a specific table for all function calls following.
  70. // * If another function is called before `setTableId`, it will assume the
  71. // * main table of the game, defined by GameJolt.
  72. // *
  73. // * `setTableId` - Set which table is currently active (0 for none)
  74. // * `add` - Add the given score to the active table
  75. // * `getRank` - Get the position of the given score in the active table,
  76. // * if no score matching, return the nearest
  77. // */
  78. //void dd_gamejolt_score_setTableId(char *tableId);
  79. //
  80. //void dd_gamejolt_score_add(int score, void (*callback)(void*), void *context, struct dd_gamejolt_response_struct *data);
  81. //void dd_gamejolt_score_getRank(int score, void (*callback)(void*), void *context, struct dd_gamejolt_response_struct *data);
  82. //void dd_gamejolt_score_fetch(int setting, int betterThan, int worseThan, int limit, void (*callback)(void*), void *context, struct dd_gamejolt_response_struct *data);
  83. //
  84. //// Getters for scores
  85. //int dd_gamejolt_response_getSuccess(struct dd_gamejolt_response_struct *);
  86. //char *dd_gamejolt_response_getMessage(struct dd_gamejolt_response_struct *);
  87. //int dd_gamejolt_response_getScoreCount(struct dd_gamejolt_response_struct *);
  88. //char *dd_gamejolt_response_getScore (struct dd_gamejolt_response_struct *, int scoreIndex);
  89. //int dd_gamejolt_response_getSort (struct dd_gamejolt_response_struct *, int scoreIndex);
  90. //char *dd_gamejolt_response_getUser (struct dd_gamejolt_response_struct *, int scoreIndex);
  91. //int dd_gamejolt_response_getUserId(struct dd_gamejolt_response_struct *, int scoreIndex);
  92. //char *dd_gamejolt_response_getGuest (struct dd_gamejolt_response_struct *, int scoreIndex);
  93. //char *dd_gamejolt_response_getStored(struct dd_gamejolt_response_struct *, int scoreIndex);
  94. //int dd_gamejolt_response_getStoredTimestamp(struct dd_gamejolt_response_struct *, int scoreIndex);
  95. //int dd_gamejolt_response_getRank(struct dd_gamejolt_response_struct *);
  96. //char *dd_gamejolt_response_getName(struct dd_gamejolt_response_struct *, int scoreIndex);
  97. //int dd_gamejolt_response_hasUser(struct dd_gamejolt_response_struct *, int scoreIndex);
  98. //
  99. void nofunc();
  100. #endif