serverfps.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/serverfps.h $*
  25. * *
  26. * $Author:: Steve_t $*
  27. * *
  28. * $Modtime:: 1/15/02 7:22p $*
  29. * *
  30. * $Revision:: 6 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef __SERVERFPS_H__
  36. #define __SERVERFPS_H__
  37. #include "networkobject.h"
  38. //-----------------------------------------------------------------------------
  39. //
  40. // A S->C mirrored object to inform clients of server fps.
  41. // This singleton object may not be statically allocated.
  42. //
  43. class cServerFps : public NetworkObjectClass
  44. {
  45. public:
  46. void Set_Fps(int fps);
  47. int Get_Fps(void) {return Fps;}
  48. void Delete (void) {}
  49. virtual void Export_Frequent(BitStreamClass &packet);
  50. virtual void Import_Frequent(BitStreamClass &packet);
  51. virtual void Set_Delete_Pending (void) {}; // Never needs deletion since it persists during a game session.
  52. //
  53. // Static methods for the global singleton instance
  54. //
  55. static void Create_Instance(void);
  56. static void Destroy_Instance(void);
  57. static cServerFps * Get_Instance(void);
  58. private:
  59. //
  60. // Constructor and destructor are private - static functions are used to
  61. // manage the global singleton instance.
  62. //
  63. cServerFps(void);
  64. ~cServerFps(void) {}
  65. int Fps;
  66. //
  67. // The global singleton instance
  68. //
  69. static cServerFps * TheInstance;
  70. };
  71. //-----------------------------------------------------------------------------
  72. #endif // __SERVERFPS_H__