CCDDE.H 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. ** Command & Conquer Red Alert(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. *** 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 ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Command & Conquer - Red Alert *
  23. * *
  24. * File Name : CCDDE.H *
  25. * *
  26. * Programmer : Steve Tall *
  27. * *
  28. * Start Date : 10/04/95 *
  29. * *
  30. * Last Update : August 5th, 1996 [ST] *
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Overview: *
  34. * C&C's interface to the DDE class *
  35. * *
  36. *---------------------------------------------------------------------------------------------*
  37. * *
  38. * Functions: *
  39. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  40. #ifdef WIN32
  41. #include "dde.h"
  42. class DDEServerClass {
  43. public:
  44. DDEServerClass (void);
  45. ~DDEServerClass (void);
  46. char *Get_MPlayer_Game_Info (void); //Returns pointer to game info
  47. int Get_MPlayer_Game_Info_Length(){return(MPlayerGameInfoLength);}; //Len of game info
  48. BOOL Callback(unsigned char *data, long length); //DDE callback function
  49. void Delete_MPlayer_Game_Info(void); //release the game info memory
  50. void Enable(void); //Enable the DDE callback
  51. void Disable(void); //Disable the DDE callback
  52. int Time_Since_Heartbeat(void); //Returns the time since the last hearbeat from WChat
  53. /*
  54. ** Enumeration for DDE packet types from WChat
  55. */
  56. enum {
  57. DDE_PACKET_START_MPLAYER_GAME, //Start game packet. This includes game options
  58. DDE_PACKET_GAME_RESULTS, //Game results packet. The game statistics.
  59. DDE_PACKET_HEART_BEAT, //Heart beat packet so we know WChat is still there.
  60. DDE_TICKLE, //Message to prompt other app to take focus.
  61. DDE_CONNECTION_FAILED
  62. };
  63. private:
  64. char *MPlayerGameInfo; //Pointer to game start packet
  65. int MPlayerGameInfoLength; //Length of game start packet.
  66. BOOL IsEnabled; //Flag for DDE callback enable
  67. int LastHeartbeat; // Time since last heartbeat packet was received from WChat
  68. };
  69. extern DDEServerClass DDEServer;
  70. extern BOOL Send_Data_To_DDE_Server (char *data, int length, int packet_type);
  71. #endif //WIN32