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.

173 lines
8.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef VALVECDKEYGAMEANDTERRITORYCODES_H
  7. #define VALVECDKEYGAMEANDTERRITORYCODES_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // imported from MainIntegration/Deliverables/Production/Client/Inc/NewValveCDKeyGenerator.h
  12. // if the enums there change, this needs to change
  13. //!! these need to be moved out into a seperate file in steam, so that src can use the directly published version
  14. //
  15. // GameCode
  16. //
  17. enum EGameCode
  18. {
  19. // DoD uses SteamInstanceId = 1
  20. // DoD CD-key Steam IDs are displayed as VALVE_1:xxxxxxxx where xxxx is the SteamLocalUserId mentioned above.
  21. // DoD CD-keys uses an odd scheme (invented in a rush) whereby the SteamLocalUserID is generated by hashing
  22. // (MD5) the CD key parameters (Territory,GameCode,UniqueSerialNumber) and truncating the resulting hash for
  23. // a reasonable display length (26 bits, i.e. eMaskLargestAcceptableLocalUserId above, which is about 8 decimal digits).
  24. // **The generator must therefore discard any UniqueSerialNumbers that cause hashes to collide.**
  25. // This means that when generating a new batch from a non-zero StartUniqueSerialNumber, the generator has
  26. // to generate them all from 0 anyway to populate an array of 'hash has been used' flags -- it then only
  27. // prints out new keys higher than the requested StartUniqueSerialNumber.
  28. // IMPORTANT: this means that each match of N keys generated consumes MORE THAN N UniqueSerialNumbers --
  29. // so each new batch MUST be started with the correct "Next StartUniqueSerialNumber" that was output
  30. // at the end of the previous batch, or the new batch will overlap with the previous batch.
  31. eDayOfDefeat = 0,
  32. // CZ uses SteamInstanceId = 2 (**as will all future games using this system**)
  33. // CZ CD-key SteamLocalUserIds have
  34. // high32bits = ( GameCode << sc_uNumBitsSalesTerritory) | SalesTerritory
  35. // low32bits = UniqueSerialNumber
  36. // CZ CD-key Steam IDs will be displayed as VALVE_2:GameCode:UniqueSerialNumber
  37. // (i.e. the DoD hashing scheme is *NOT* used).
  38. eConditionZero = 1,
  39. // CyberCafes receive all legacy and future products, under this one code.
  40. // They have their own SalesTerritory codes too.
  41. // If a CDKey has this game code OR a CyberCafe SalesTerritory then it is a 'cybercafe CDkey'.
  42. eCyberCafeBundle = 2,
  43. eHalfLife2 = 3,
  44. eHalfLife2RetailCE = 4,
  45. eHalfLife2Retail = 5,
  46. };
  47. //
  48. // SalesTerritory
  49. //
  50. enum ESalesTerritory
  51. {
  52. // DoD first batch 80,000 keys **Next free 'StartUniqueSerialNumber' = 80032
  53. // DoD second batch 30,000 keys **Next free 'StartUniqueSerialNumber' = 110081
  54. // OLD KEY ... NOTE: this CZ first batch for USA (code 0) of 275,000 may also be distributed in Canada
  55. // OLD KEY ... i.e. they should ideally have had code 11, but we didn't want to re-issue them.
  56. // OLD KEY ConditionZero first batch 275,000 keys **Next free 'StartUniqueSerialNumber' = 275000
  57. // NEW KEY These were moved to region 11 as suggested above (part of first batch of 379,000)
  58. eUSA = 0,
  59. // DoD first batch 7,500 keys **Next free 'StartUniqueSerialNumber' = 7500
  60. eAustralia = 1,
  61. // DoD first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  62. eKorea = 2,
  63. // DoD first batch 10,000 keys **Next free 'StartUniqueSerialNumber' = 10000
  64. eTaiwan = 3,
  65. // DoD first batch 5,000 keys **Next free 'StartUniqueSerialNumber' = 5000
  66. eJapan = 4,
  67. // DoD first batch 25,000 keys **Next free 'StartUniqueSerialNumber' = 25003
  68. // ConditionZero first batch 99,000 keys **Next free 'StartUniqueSerialNumber' = 99000
  69. eUK = 5,
  70. // DoD first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15002
  71. // ConditionZero first batch 77,000 keys **Next free 'StartUniqueSerialNumber' = 77000
  72. eFrance = 6,
  73. // DoD first batch 3,000 keys **Next free 'StartUniqueSerialNumber' = 3000
  74. // DoD second batch 5,000 keys **Next free 'StartUniqueSerialNumber' = 8002
  75. // ConditionZero first batch 132,000 keys **Next free 'StartUniqueSerialNumber' = 132000
  76. eGermany = 7,
  77. // DoD first batch 3,000 keys **Next free 'StartUniqueSerialNumber' = 3000
  78. // ConditionZero first batch 27,500 keys **Next free 'StartUniqueSerialNumber' = 27500
  79. eSpain = 8,
  80. // DoD first batch 3,000 keys **Next free 'StartUniqueSerialNumber' = 3000
  81. // ConditionZero first batch 44,000 keys **Next free 'StartUniqueSerialNumber' = 44000
  82. eItaly = 9,
  83. // DoD first batch 65,000 keys **Next free 'StartUniqueSerialNumber' = 65039
  84. // DoD second batch 20,000 keys **Next free 'StartUniqueSerialNumber' = 85058
  85. eChina = 10,
  86. // This is ALL 'American' ENGLISH-SPEAKING TERRITORIES (e.g. USA, Austrailia, Canada, NZ, but *NOT* UK).
  87. // Vivendi track sales by language, rather that geographically.
  88. // OLD KEY ... NOTE: CZ first batch for USA (code 0) of 275,000 will also be distributed in these territories
  89. // OLD KEY ... i.e. they should ideally have had this code, but we didn't want to re-issue them.
  90. // OLD KEY ConditionZero first batch 25,000 keys **Next free 'StartUniqueSerialNumber' = 25000
  91. // OLD KEY ConditionZero second batch 79,000 keys **Next free 'StartUniqueSerialNumber' = 104000
  92. // NEW KEY ConditionZero first batch 379,000 keys **Next free 'StartUniqueSerialNumber' =
  93. eEnglish = 11,
  94. // CyberCafe specific territories. If a CDKey has this game code OR a CyberCafe SalesTerritory then it is a 'cybercafe CDkey'.
  95. // CyberCafeBundle first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  96. eCyberCafeEurope = 12,
  97. // CyberCafeBundle first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  98. eCyberCafeNorthAndSouthAmerica = 13,
  99. // CyberCafeBundle first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  100. eCyberCafeKorea = 14,
  101. // CyberCafeBundle first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  102. eCyberCafeChinaTaiwan = 15,
  103. // CyberCafeBundle first batch 15,000 keys **Next free 'StartUniqueSerialNumber' = 15000
  104. eCyberCafeRestOfAsia = 16,
  105. // ATI OEM
  106. // *** After intranet security breach, only the first 40,000 of these keys are valid:
  107. // OLD KEY HL2 first batch 250,000 keys
  108. // *** After intranet security breach, these keys use a new MAC key:
  109. // NEW KEY HL2 first batch start=40,000 210,000 keys
  110. eATI_OEM = 17,
  111. // ConditionZero first batch 5,500 keys **Next free 'StartUniqueSerialNumber' = 5500
  112. eLatinAmerica = 18,
  113. // ConditionZero first batch 16,500 keys **Next free 'StartUniqueSerialNumber' = 16500
  114. eBrazil = 19,
  115. // ConditionZero first batch 66,000 keys **Next free 'StartUniqueSerialNumber' = 66000
  116. eNordic = 20,
  117. // This a Vivendi code meaning "Belgium, Luxembourg, French speaking territories of Africa, French overseas departments, Netherlands, Quebec"
  118. // ConditionZero first batch 40,700 keys **Next free 'StartUniqueSerialNumber' = 40700
  119. eExportFrance = 21,
  120. // This a Vivendi code meaning "Austria, Switzerland, Bulgaria, Czech Republic, Hungary, Lithuania, Poland, Romania, Russian Federation, Slovenia, Slovakia"
  121. // ConditionZero first batch 16,500 keys **Next free 'StartUniqueSerialNumber' = 16500
  122. eExportNorth = 22,
  123. // This a Vivendi code meaning "Cyprus, Egypt, Greece, Israel, Lebanon, Malta, Turkey"
  124. // ConditionZero first batch 40,700 keys **Next free 'StartUniqueSerialNumber' = 40700
  125. eExportSouth = 23,
  126. // MISSING ONES ARE ON MI (24..29)
  127. // ATI Rebate
  128. // HL2 first batch 100,000 keys
  129. eATI_Rebate = 30,
  130. // Used for internal and pre-release testing keys.
  131. // DoD first batch 20 keys **Next free 'StartUniqueSerialNumber' = 20
  132. // DoD second batch 150 keys **Next free 'StartUniqueSerialNumber' = 170
  133. // DoD second batch 500 keys **Next free 'StartUniqueSerialNumber' = 670
  134. // ConditionZero first batch 200 keys **Next free 'StartUniqueSerialNumber' = 200
  135. // CyberCafeBundle first batch 100 keys **Next free 'StartUniqueSerialNumber' = 100
  136. eInternal = 255
  137. };
  138. #endif // VALVECDKEYGAMEANDTERRITORYCODES_H