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