netinterface.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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: netinterface.h
  20. // Project: Network.lib, for Commando
  21. // Author: Tom Spencer-Smith
  22. // Date: Dec 1998
  23. // Description:
  24. //
  25. //-----------------------------------------------------------------------------
  26. #if defined(_MSV_VER)
  27. #pragma once
  28. #endif
  29. #ifndef NETINTERFACE_H
  30. #define NETINTERFACE_H
  31. #include "bittype.h"
  32. #include "widestring.h"
  33. //GAMESPY - allow 30 chars + ( + 2 chars for collision (add 2..99) + ) + NULL
  34. //const USHORT MAX_NICKNAME_LENGTH = 17; // Includes NULL.
  35. const USHORT MAX_NICKNAME_LENGTH = 35;
  36. //-----------------------------------------------------------------------------
  37. class cNetInterface
  38. {
  39. public:
  40. cNetInterface(void);
  41. ~cNetInterface(void);
  42. static void Set_Random_Nickname(void);
  43. static void Set_Nickname(WideStringClass & name);
  44. static WideStringClass Get_Nickname(void);
  45. static void Set_Side_Preference(int side);
  46. static int Get_Side_Preference(void);
  47. private:
  48. cNetInterface(const cNetInterface& rhs); // Disallow copy (compile/link time)
  49. cNetInterface& operator=(const cNetInterface& rhs); // Disallow assignment (compile/link time)
  50. static WideStringClass Nickname;
  51. static int mSidePreference;
  52. };
  53. //-----------------------------------------------------------------------------
  54. #endif // NETINTERFACE_H
  55. //static WideStringClass & Get_Nickname(void);