Skip to content

Commit bdd2d31

Browse files
committed
fix(unify): restore GeneralsMD GameSpy files - cannot be unified yet
1 parent 419ea74 commit bdd2d31

File tree

6 files changed

+1557
-0
lines changed

6 files changed

+1557
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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: GameSpyChat.h //////////////////////////////////////////////////////
26+
// Generals GameSpy Chat
27+
// Author: Matthew D. Campbell, February 2002
28+
29+
#pragma once
30+
31+
#include "gamespy/peer/peer.h"
32+
33+
class GameWindow;
34+
class WindowLayout;
35+
36+
Bool GameSpySendChat(UnicodeString message, Bool isEmote, GameWindow *playerListbox = NULL);
37+
void GameSpyAddText( UnicodeString message, GameSpyColors color = GSCOLOR_DEFAULT );
38+
39+
extern GameWindow *progressTextWindow; ///< Text box on the progress screen
40+
extern GameWindow *quickmatchTextWindow; ///< Text box on the quickmatch screen
41+
extern GameWindow *quickmatchTextWindow; ///< Text box on the quickmatch screen
42+
extern GameWindow *listboxLobbyChat; ///< Chat box on the custom lobby screen
43+
extern GameWindow *listboxLobbyPlayers; ///< Player box on the custom lobby screen
44+
extern GameWindow *listboxLobbyGames; ///< Game box on the custom lobby screen
45+
extern GameWindow *listboxLobbyChatChannels; ///< Chat channel box on the custom lobby screen
46+
extern GameWindow *listboxGameSetupChat; ///< Chat box on the custom game setup screen
47+
extern WindowLayout *WOLMapSelectLayout; ///< Map selection overlay
48+
49+
void RoomMessageCallback(PEER peer, RoomType roomType,
50+
const char * nick, const char * message,
51+
MessageType messageType, void * param); ///< Called when a message arrives in a room.
52+
53+
void PlayerMessageCallback(PEER peer, const char * nick,
54+
const char * message, MessageType messageType,
55+
void * param); ///< Called when a private message is received from another player.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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: GameSpyGP.h //////////////////////////////////////////////////////
26+
// Generals GameSpy GP (Buddy)
27+
// Author: Matthew D. Campbell, March 2002
28+
29+
#pragma once
30+
31+
#include "gamespy/gp/gp.h"
32+
33+
void GPRecvBuddyRequestCallback(GPConnection * connection, GPRecvBuddyRequestArg * arg, void * param);
34+
void GPRecvBuddyMessageCallback(GPConnection * pconnection, GPRecvBuddyMessageArg * arg, void * param);
35+
void GPRecvBuddyStatusCallback(GPConnection * connection, GPRecvBuddyStatusArg * arg, void * param);
36+
void GPErrorCallback(GPConnection * pconnection, GPErrorArg * arg, void * param);
37+
void GPConnectCallback(GPConnection * pconnection, GPConnectResponseArg * arg, void * param);
38+
void GameSpyUpdateBuddyOverlay(void);
39+
40+
extern GPConnection *TheGPConnection;
41+
42+
Bool IsGameSpyBuddy(GPProfile id);
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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

Comments
 (0)