apppacketstats.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/apppacketstats.h $*
  25. * *
  26. * $Author:: Tom_s $*
  27. * *
  28. * $Modtime:: 10/15/01 4:18p $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef __APPPACKETSTATS_H__
  36. #define __APPPACKETSTATS_H__
  37. #include "bittype.h"
  38. #include "apppackettypes.h"
  39. #include "networkobject.h"
  40. //-----------------------------------------------------------------------------
  41. //
  42. // Record and report app packet stats
  43. //
  44. class cAppPacketStats
  45. {
  46. public:
  47. static void Reset(void);
  48. static void Dump_Diagnostics(void);
  49. static LPCSTR Interpret_Type(BYTE app_packet_type);
  50. static void Update_Object_Tally(void);
  51. static void Increment_Packets_Sent(BYTE app_packet_type);
  52. static void Increment_Bits_Sent(BYTE app_packet_type, DWORD bits);
  53. static void Increment_Bits_Sent_Tier(BYTE app_packet_type, PACKET_TIER_ENUM tier, DWORD bits);
  54. static DWORD Get_Packets_Sent(BYTE app_packet_type);
  55. static DWORD Get_Bits_Sent(BYTE app_packet_type);
  56. static DWORD Get_Bits_Sent_Tier(BYTE app_packet_type, PACKET_TIER_ENUM tier);
  57. static DWORD Get_Object_Tally(BYTE app_packet_type);
  58. static StringClass & Get_Heading(void);
  59. static StringClass & Get_Description(BYTE app_packet_type);
  60. private:
  61. static DWORD PacketsSent[APPPACKETTYPE_COUNT];
  62. static DWORD BitsSent[APPPACKETTYPE_COUNT];
  63. static DWORD BitsSentTier[APPPACKETTYPE_COUNT][PACKET_TIER_COUNT];
  64. static DWORD ObjectTally[APPPACKETTYPE_COUNT];
  65. static StringClass WorkingString;
  66. };
  67. //-----------------------------------------------------------------------------
  68. #endif // __APPPACKETSTATS_H__