gamespyadmin.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. ** Command & Conquer Renegade(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. // Filename: gamespyadmin.h
  20. // Author: Tom Spencer-Smith
  21. // Date: Jan 2002
  22. // Description: Gamespy support
  23. //
  24. #ifndef __GAMESPY_H__
  25. #define __GAMESPY_H__
  26. #include "bittype.h"
  27. #include "DlgWOLWait.h"
  28. #include <WWLib\Notify.h>
  29. #include <WWOnline\RefPtr.h>
  30. // #include <WWLib\RefCount.h>
  31. class WideStringClass;
  32. //-----------------------------------------------------------------------------
  33. class cGameSpyAdmin :
  34. public Observer<DlgWOLWaitEvent>
  35. //, public RefCountClass
  36. {
  37. public:
  38. static void Think(void);
  39. static void Reset(void);
  40. static void Set_Is_Under_Gamespy_Menuing(bool flag) {IsUnderGamespyMenuing = flag;}
  41. static bool Get_Is_Under_Gamespy_Menuing(void) {return IsUnderGamespyMenuing;}
  42. static void Set_Is_Launch_From_Gamespy_Requested(bool flag) {IsLaunchFromGamespyRequested = flag;}
  43. static bool Get_Is_Launch_From_Gamespy_Requested(void) {return IsLaunchFromGamespyRequested;}
  44. static void Set_Is_Launched_From_Gamespy(bool flag) {IsLaunchedFromGamespy = flag;}
  45. static bool Get_Is_Launched_From_Gamespy(void) {return IsLaunchedFromGamespy;}
  46. static void Set_Is_Server_Gamespy_Listed(bool flag) {IsServerGamespyListed = flag;}
  47. static bool Get_Is_Server_Gamespy_Listed(void) {return IsServerGamespyListed;}
  48. static void Set_Game_Host_Ip(ULONG ip);
  49. static void Set_Game_Host_Port(USHORT port);
  50. static bool Is_Gamespy_Game(void);
  51. static bool Is_Nickname_Collision(WideStringClass & nickname);
  52. static void Set_Password_Attempt(WideStringClass & password) {PasswordAttempt = password;}
  53. static WideStringClass & Get_Password_Attempt(void) {return PasswordAttempt;}
  54. private:
  55. void HandleNotification(DlgWOLWaitEvent& event);
  56. static void Join_Server(void);
  57. static void Connect_To_Game_Server(void);
  58. static bool DetectingBandwidth;
  59. static bool IsUnderGamespyMenuing;
  60. static bool IsLaunchFromGamespyRequested;
  61. static bool IsLaunchedFromGamespy;
  62. static bool IsServerGamespyListed;
  63. static ULONG GameHostIp;
  64. static USHORT GameHostPort;
  65. static WideStringClass PasswordAttempt;
  66. };
  67. //-----------------------------------------------------------------------------
  68. #endif // __GAMESPY_H__
  69. //static WideStringClass PlayerNickname;
  70. //static void Set_Player_Nickname(WideStringClass & nickname);