GameSpy_QnR.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _GAMESPY_QNR_H_
  19. #define _GAMESPY_QNR_H_
  20. /********
  21. INCLUDES
  22. ********/
  23. #include <GameSpy\gqueryreporting.h>
  24. #include <WWLib\WideString.h>
  25. #include "trim.h"
  26. /********
  27. DEFINES
  28. ********/
  29. class CGameSpyQnR
  30. {
  31. protected:
  32. char secret_key[9];
  33. BOOL m_GSInit;
  34. BOOL m_GSEnabled;
  35. qr_t query_reporting_rec;
  36. void DoGameStuff(void);
  37. BOOL Append_InfoKey_Pair(char *outbuf, int maxlen, const char *key, const char *value);
  38. BOOL Append_InfoKey_Pair(char *outbuf, int maxlen, const char *key, const StringClass &value);
  39. BOOL Append_InfoKey_Pair(char *outbuf, int maxlen, const char *key, const WideStringClass &value);
  40. static const char *gamename;
  41. static const char *bname;
  42. static const int prodid;
  43. static const int cdkey_id;
  44. static const char *default_heartbeat_list;
  45. int StartTime;
  46. public:
  47. void Init(void);
  48. void LaunchArcade(void);
  49. void TrackUsage(void);
  50. void Shutdown(void);
  51. BOOL Parse_HeartBeat_List(const char *list);
  52. const char *Get_GameSpy_GameName(void) { return gamename; }
  53. const char *Get_Default_HeartBeat_List(void) { return default_heartbeat_list; }
  54. void Enable_Reporting(BOOL enable) { m_GSEnabled = enable; }
  55. BOOL IsEnabled(void) { return m_GSEnabled; }
  56. void Think();
  57. void basic_callback(char *outbuf, int maxlen);
  58. void info_callback(char *outbuf, int maxlen);
  59. void rules_callback(char *outbuf, int maxlen);
  60. void players_callback(char *outbuf, int maxlen);
  61. CGameSpyQnR();
  62. virtual ~CGameSpyQnR();
  63. };
  64. extern CGameSpyQnR GameSpyQnR;
  65. #endif