WOLGameInfo.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/Commando/WOLGameInfo.h $
  22. *
  23. * DESCRIPTION
  24. *
  25. * PROGRAMMER
  26. * $Author: Steve_t $
  27. *
  28. * VERSION INFO
  29. * $Revision: 11 $
  30. * $Modtime: 10/31/02 3:07p $
  31. *
  32. ******************************************************************************/
  33. #ifndef __WOLGAMEINFO_H__
  34. #define __WOLGAMEINFO_H__
  35. #include <WWOnline\RefPtr.h>
  36. class cGameData;
  37. namespace WWOnline
  38. {
  39. class ChannelData;
  40. class UserData;
  41. }
  42. // Game information used to describe the type of game.
  43. class WOLGameInfo
  44. {
  45. public:
  46. static bool IsValidGameChannel(const RefPtr<WWOnline::ChannelData>& channel);
  47. enum {MAX_TEXT_LENGTH = 32};
  48. WOLGameInfo(void);
  49. WOLGameInfo(const cGameData& theGame);
  50. WOLGameInfo(const RefPtr<WWOnline::ChannelData>& channel);
  51. ~WOLGameInfo(void);
  52. void Reset(void);
  53. bool IsDataValid(void) const
  54. {return mIsDataValid;}
  55. bool IsMapValid(void) const
  56. {return mIsMapValid;}
  57. void ImportFromGame(const cGameData& theGame);
  58. void ImportFromChannel(const RefPtr<WWOnline::ChannelData>& channel);
  59. void ExportToChannel(const RefPtr<WWOnline::ChannelData>& channel);
  60. unsigned long Version(void) const
  61. {return mVersion;};
  62. unsigned int GameType(void) const
  63. {return mGameType;}
  64. const char* MapName(void) const
  65. {return mMapName;}
  66. const char* ModName(void) const
  67. {return mModName;}
  68. const char* Title(void) const
  69. {return mTitle;}
  70. unsigned int MinPlayers(void) const
  71. {return mMinPlayers;}
  72. unsigned int MaxPlayers(void) const
  73. {return mMaxPlayers;}
  74. unsigned int NumPlayers(void) const
  75. {return mNumPlayers;}
  76. unsigned long ClanID1(void) const
  77. {return mClanID1;}
  78. unsigned long ClanID2(void) const
  79. {return mClanID2;}
  80. bool IsLaddered(void) const
  81. {return mIsLaddered;}
  82. bool IsPassworded(void) const
  83. {return mIsPassworded;}
  84. bool IsQuickmatch(void) const
  85. {return mIsQuickmatch;}
  86. bool IsDedicated(void) const
  87. {return mIsDedicated;}
  88. bool IsFriendlyFire(void) const
  89. {return mIsFriendlyFire;}
  90. bool IsFreeWeapons(void) const
  91. {return mIsFreeWeapons;}
  92. bool IsTeamRemix(void) const
  93. {return mIsTeamRemix;}
  94. bool IsTeamChange(void) const
  95. {return mIsTeamChange;}
  96. bool IsClanGame(void) const
  97. {return mIsClanGame;}
  98. bool IsRepairBuildings(void) const
  99. {return mIsRepairBuildings;}
  100. bool IsDriverGunner(void) const
  101. {return mIsDriverGunner;}
  102. bool IsSpawnWeapons(void) const
  103. {return mSpawnWeapons;}
  104. int PingTime(void) const
  105. {return mPingTime;}
  106. // Is the clan competing in the game.
  107. bool IsClanCompeting(unsigned long clanID) const;
  108. bool IsClanGameOpen(void) const;
  109. bool CanUserJoin(const RefPtr<WWOnline::UserData>& user);
  110. protected:
  111. // Prevent copy and assignment
  112. WOLGameInfo(const WOLGameInfo&);
  113. const WOLGameInfo& operator=(const WOLGameInfo&);
  114. protected:
  115. bool mIsDataValid;
  116. bool mIsMapValid;
  117. unsigned long mVersion;
  118. unsigned int mGameType;
  119. char mMapName[MAX_TEXT_LENGTH];
  120. char mModName[MAX_TEXT_LENGTH];
  121. char mTitle[MAX_TEXT_LENGTH];
  122. unsigned int mMinPlayers;
  123. unsigned int mMaxPlayers;
  124. unsigned int mNumPlayers;
  125. unsigned long mClanID1;
  126. unsigned long mClanID2;
  127. bool mIsMod;
  128. bool mIsLaddered;
  129. bool mIsPassworded;
  130. bool mIsQuickmatch;
  131. bool mIsDedicated;
  132. bool mIsFriendlyFire;
  133. bool mIsFreeWeapons;
  134. bool mIsTeamRemix;
  135. bool mIsTeamChange;
  136. bool mIsClanGame;
  137. bool mIsRepairBuildings;
  138. bool mIsDriverGunner;
  139. bool mSpawnWeapons;
  140. int mPingTime;
  141. };
  142. #endif // __WOLGAMEINFO_H__