ServerSettings.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Commando/ServerSettings.h $*
  25. * *
  26. * $Author:: Steve_t $*
  27. * *
  28. * $Modtime:: 8/08/02 1:00p $*
  29. * *
  30. * $Revision:: 7 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #include <win.h>
  36. #include "wwonline\wolsession.h"
  37. class StringClass;
  38. class ServerSettingsClass
  39. {
  40. public:
  41. enum GameModeTypeEnum {
  42. MODE_NONE = 0,
  43. MODE_LAN,
  44. MODE_WOL,
  45. MODE_GAMESPY
  46. };
  47. static void Set_Settings_File_Name(char *filename);
  48. static bool Is_Server_Settings_File_Set(void) {return((SettingsFile[0] == 0) ? false : true);}
  49. static bool Parse(bool apply = false);
  50. static bool Is_Command_Line_Mode(void) {return(IsActive);}
  51. static void Encrypt_Serial(StringClass serial_in, StringClass &serial_out, bool encrypt = true);
  52. static void Decrypt_Serial(StringClass serial_in, StringClass &serial_out);
  53. static const char *Get_Master_Server_Password(void) {return(MasterPassword);}
  54. static unsigned long Get_Master_Bandwidth(void) {return(MasterBandwidth);}
  55. static bool Is_Active(void) {return(IsActive);}
  56. static char *Get_Settings_File_Name(void) {return(SettingsFile);}
  57. static bool Check_Game_Settings_File(char *config_file);
  58. static GameModeTypeEnum Get_Game_Mode(void) {return(GameMode);}
  59. static int Get_Disk_Log_Size(void) {return(DiskLogSize);}
  60. /*
  61. ** Populating ini file with server list.
  62. */
  63. static char *Get_Preferred_Server(const WWOnline::IRCServerList &server_list);
  64. static void Write_Server_List(const WWOnline::IRCServerList &server_listvoid);
  65. private:
  66. static char SettingsFile[MAX_PATH];
  67. static bool IsActive;
  68. static char MasterPassword[128];
  69. static unsigned long MasterBandwidth;
  70. static char PreferredLoginServer[256];
  71. static GameModeTypeEnum GameMode;
  72. static int DiskLogSize;
  73. };