CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

CCDDE.H (4451B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 
     17 /***********************************************************************************************
     18  ***              C O N F I D E N T I A L  ---  W E S T W O O D  S T U D I O S               ***
     19  ***********************************************************************************************
     20  *                                                                                             *
     21  *                 Project Name : Command & Conquer - Red Alert                                *
     22  *                                                                                             *
     23  *                    File Name : CCDDE.H                                                      *
     24  *                                                                                             *
     25  *                   Programmer : Steve Tall                                                   *
     26  *                                                                                             *
     27  *                   Start Date : 10/04/95                                                     *
     28  *                                                                                             *
     29  *                  Last Update : August 5th, 1996 [ST]                                        *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Overview:                                                                                   *
     33  *   C&C's interface to the DDE class                                                          *
     34  *                                                                                             *
     35  *---------------------------------------------------------------------------------------------*
     36  *                                                                                             *
     37  * Functions:                                                                                  *
     38  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     39 
     40 #ifdef WIN32
     41 
     42 #include "dde.h"
     43 
     44 class DDEServerClass {
     45 
     46 	public:
     47 
     48 		DDEServerClass (void);
     49 		~DDEServerClass (void);
     50 
     51 
     52 		char 	*Get_MPlayer_Game_Info (void);					//Returns pointer to game info
     53 		int    Get_MPlayer_Game_Info_Length(){return(MPlayerGameInfoLength);};	//Len of game info
     54 		BOOL	 Callback(unsigned char *data, long length);	//DDE callback function
     55 		void	 Delete_MPlayer_Game_Info(void);					//release the game info memory
     56 		void	 Enable(void);											//Enable the DDE callback
     57 		void	 Disable(void);										//Disable the DDE callback
     58 		int	 Time_Since_Heartbeat(void);						//Returns the time since the last hearbeat from WChat
     59 
     60 		/*
     61 		** Enumeration for DDE packet types from WChat
     62 		*/
     63 		enum {
     64 			DDE_PACKET_START_MPLAYER_GAME,		//Start game packet. This includes game options
     65 			DDE_PACKET_GAME_RESULTS,				//Game results packet. The game statistics.
     66 			DDE_PACKET_HEART_BEAT,					//Heart beat packet so we know WChat is still there.
     67 			DDE_TICKLE,									//Message to prompt other app to take focus.
     68 			DDE_CONNECTION_FAILED
     69 		};
     70 
     71 
     72 	private:
     73 
     74 		char 				*MPlayerGameInfo;			//Pointer to game start packet
     75 		int				MPlayerGameInfoLength;	//Length of game start packet.
     76 		BOOL				IsEnabled;					//Flag for DDE callback enable
     77 		int				LastHeartbeat;		// Time since last heartbeat packet was received from WChat
     78 
     79 };
     80 
     81 
     82 extern DDEServerClass DDEServer;
     83 extern BOOL Send_Data_To_DDE_Server (char *data, int length, int packet_type);
     84 
     85 
     86 #endif	//WIN32