Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Holds the CTFDualSummary
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TFDUELSUMMARY_H
  8. #define TFDUELSUMMARY_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "gcsdk/protobufsharedobject.h"
  13. #include "tf_gcmessages.h"
  14. // do not re-order, stored in DB
  15. enum eDuelStatus
  16. {
  17. kDuelStatus_Loss,
  18. kDuelStatus_Tie,
  19. kDuelStatus_Win,
  20. };
  21. // do not re-order, stored in DB
  22. enum eDuelEndReason
  23. {
  24. kDuelEndReason_DuelOver,
  25. kDuelEndReason_PlayerDisconnected,
  26. kDuelEndReason_PlayerSwappedTeams,
  27. kDuelEndReason_LevelShutdown,
  28. kDuelEndReason_ScoreTiedAtZero,
  29. kDuelEndReason_PlayerKicked,
  30. kDuelEndReason_PlayerForceSwappedTeams,
  31. kDuelEndReason_ScoreTied,
  32. kDuelEndReason_Cancelled
  33. };
  34. const char *PchNameFromeDuelEndReason( eDuelEndReason eReason );
  35. const uint32 kWinsPerLevel = 10;
  36. //---------------------------------------------------------------------------------
  37. // Purpose:
  38. //---------------------------------------------------------------------------------
  39. class CTFDuelSummary : public GCSDK::CProtoBufSharedObject< CSOTFDuelSummary, k_EEconTypeDuelSummary >
  40. {
  41. #ifdef GC
  42. DECLARE_CLASS_MEMPOOL( CTFDuelSummary );
  43. #endif
  44. public:
  45. #ifdef GC
  46. virtual bool BYieldingAddInsertToTransaction( GCSDK::CSQLAccess & sqlAccess );
  47. virtual bool BYieldingAddWriteToTransaction( GCSDK::CSQLAccess & sqlAccess, const CUtlVector< int > &fields );
  48. virtual bool BYieldingAddRemoveToTransaction( GCSDK::CSQLAccess & sqlAccess );
  49. void WriteToRecord( CSchDuelSummary *pDuelSummary ) const;
  50. void ReadFromRecord( const CSchDuelSummary & duelSummary );
  51. #endif
  52. };
  53. #endif //TFDUELSUMMARY_H