GameSpyGameInfo.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. ** Command & Conquer Generals(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. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: GameSpyGameInfo.h //////////////////////////////////////////////////////
  24. // Generals GameSpy game setup information
  25. // Author: Matthew D. Campbell, February 2002
  26. #pragma once
  27. #error this file is obsolete
  28. #ifndef __GAMESPYGAMEINFO_H__
  29. #define __GAMESPYGAMEINFO_H__
  30. #include "GameSpy/Peer/Peer.h"
  31. #include "GameNetwork/GameInfo.h"
  32. class Transport;
  33. class NAT;
  34. class GameSpyGameSlot : public GameSlot
  35. {
  36. public:
  37. GameSpyGameSlot();
  38. Int getProfileID( void ) { return m_profileID; }
  39. void setProfileID( Int id ) { m_profileID = id; }
  40. AsciiString getLoginName( void ) { return m_gameSpyLogin; }
  41. void setLoginName( AsciiString name ) { m_gameSpyLogin = name; }
  42. AsciiString getLocale( void ) { return m_gameSpyLocale; }
  43. void setLocale( AsciiString name ) { m_gameSpyLocale = name; }
  44. protected:
  45. Int m_profileID;
  46. AsciiString m_gameSpyLogin;
  47. AsciiString m_gameSpyLocale;
  48. };
  49. /**
  50. * GameSpyGameInfo class - maintains information about the GameSpy game and
  51. * the contents of its slot list throughout the game.
  52. */
  53. class GameSpyGameInfo : public GameInfo
  54. {
  55. private:
  56. GameSpyGameSlot m_GameSpySlot[MAX_SLOTS]; ///< The GameSpy Games Slot List
  57. SBServer m_server;
  58. Bool m_hasBeenQueried;
  59. Transport *m_transport;
  60. Bool m_isQM;
  61. public:
  62. GameSpyGameInfo();
  63. inline void setServer(SBServer server) { m_server = server; }
  64. inline SBServer getServer( void ) { return m_server; }
  65. AsciiString generateGameResultsPacket( void );
  66. virtual void init(void);
  67. virtual void resetAccepted(void); ///< Reset the accepted flag on all players
  68. void markGameAsQM( void ) { m_isQM = TRUE; }
  69. virtual void startGame(Int gameID); ///< Mark our game as started and record the game ID.
  70. virtual Int getLocalSlotNum( void ) const; ///< Get the local slot number, or -1 if we're not present
  71. void gotGOACall( void ); ///< Mark the game info as having been queried
  72. };
  73. extern GameSpyGameInfo *TheGameSpyGame;
  74. void WOLDisplayGameOptions( void );
  75. void WOLDisplaySlotList( void );
  76. void GameSpyStartGame( void );
  77. void GameSpyLaunchGame( void );
  78. Bool GetLocalChatConnectionAddress(AsciiString serverName, UnsignedShort serverPort, UnsignedInt& localIP);
  79. #endif // __LANGAMEINFO_H__