Counter Strike : Global Offensive Source Code
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.

143 lines
4.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VMPI_DEFS_H
  8. #define VMPI_DEFS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // This goes in front of all packets.
  13. #define VMPI_PROTOCOL_VERSION 5
  14. // This represents the protocol between the service and its UI.
  15. #define VMPI_SERVICE_UI_PROTOCOL_VERSION 1
  16. // NOTE: the service version (embedded in vmpi_service.exe as a resource) is the version
  17. // that is used to apply patches.
  18. #define VMPI_SERVICE_IDS_VERSION_STRING 102 // This matches IDS_VERSION_STRING in vmpi_service.exe.
  19. // Known packet IDs in various systems.
  20. #define VMPI_PACKETID_FILESYSTEM 0 // The file system reserves this packet ID.
  21. // All application traffic must set its first byte to something other
  22. // than this value.
  23. #define VMPI_SHARED_PACKET_ID 10
  24. // This value is put in the RunningTimeMS until the job is finished. This is how
  25. // the job_search app knows if a job never finished.
  26. #define RUNNINGTIME_MS_SENTINEL 0xFEDCBAFD
  27. #define VMPI_SERVICE_NAME_INTERNAL "VMPI"
  28. #define VMPI_SERVICE_NAME "Valve MPI Service"
  29. // Stuff in the registry goes under here (in HKEY_LOCAL_MACHINE).
  30. #define VMPI_SERVICE_KEY "Software\\Valve\\VMPI"
  31. #define SERVICE_INSTALL_LOCATION_KEY "InstallLocation"
  32. // The VMPI service listens on one of these ports to talk to the UI.
  33. #define VMPI_SERVICE_FIRST_UI_PORT 23300
  34. #define VMPI_SERVICE_LAST_UI_PORT 23310
  35. // Port numbers that the master will use to broadcast unless -mpi_port is used.
  36. #define VMPI_MASTER_FIRST_PORT 23311
  37. #define VMPI_MASTER_LAST_PORT 23330
  38. // Packet IDs for vmpi_service to talk to UI clients.
  39. #define VMPI_SERVICE_TO_UI_CONSOLE_TEXT 0 // Print some text to the UI's console.
  40. #define VMPI_SERVICE_TO_UI_STATE 1 // Updates state reflecting whether it's idle, busy, etc.
  41. #define VMPI_SERVICE_TO_UI_PATCHING 2 // Updates state reflecting whether it's idle, busy, etc.
  42. #define VMPI_SERVICE_TO_UI_EXIT 3 // Updates state reflecting whether it's idle, busy, etc.
  43. // Application state.. these are communicated between the service and the UI.
  44. enum
  45. {
  46. VMPI_SERVICE_STATE_IDLE=0,
  47. VMPI_SERVICE_STATE_BUSY,
  48. VMPI_SERVICE_STATE_DISABLED
  49. };
  50. #define VMPI_SERVICE_DISABLE 2 // Stop waiting for jobs..
  51. #define VMPI_SERVICE_ENABLE 3
  52. #define VMPI_SERVICE_UPDATE_PASSWORD 4 // New password.
  53. #define VMPI_SERVICE_EXIT 5 // User chose "exit" from the menu. Kill the service.
  54. #define VMPI_SERVICE_SKIP_CSX_JOBS 6
  55. #define VMPI_SERVICE_SCREENSAVER_MODE 7
  56. // The worker service waits on this range of ports.
  57. #define VMPI_SERVICE_PORT 23397
  58. #define VMPI_LAST_SERVICE_PORT (VMPI_SERVICE_PORT + 15)
  59. #define VMPI_WORKER_PORT_FIRST 22340
  60. #define VMPI_WORKER_PORT_LAST 22350
  61. // The VMPI service downloader is still a worker but it uses this port range so the
  62. // master knows it's just downloading the exes.
  63. #define VMPI_SERVICE_DOWNLOADER_PORT_FIRST 22351
  64. #define VMPI_SERVICE_DOWNLOADER_PORT_LAST 22360
  65. // Give it a small range so they can have multiple masters running.
  66. #define VMPI_MASTER_PORT_FIRST 21140
  67. #define VMPI_MASTER_PORT_LAST 21145
  68. #define VMPI_MASTER_FILESYSTEM_BROADCAST_PORT 21146
  69. // Protocol.
  70. // The message format is:
  71. // - VMPI_PROTOCOL_VERSION
  72. // - null-terminated password string (or VMPI_PASSWORD_OVERRIDE followed by a zero to process it regardless of pw).
  73. // - packet ID
  74. // - payload
  75. #define VMPI_PASSWORD_OVERRIDE -111
  76. #define VMPI_MESSAGE_BASE 71
  77. // This is the broadcast message from the main (rank 0) process looking for workers.
  78. #define VMPI_LOOKING_FOR_WORKERS (VMPI_MESSAGE_BASE+0)
  79. // This is so an app can find out what machines are running the service.
  80. #define VMPI_PING_REQUEST (VMPI_MESSAGE_BASE+2)
  81. #define VMPI_PING_RESPONSE (VMPI_MESSAGE_BASE+3)
  82. // This tells the service to quit.
  83. #define VMPI_STOP_SERVICE (VMPI_MESSAGE_BASE+6)
  84. // This tells the service to kill any process it has running.
  85. #define VMPI_KILL_PROCESS (VMPI_MESSAGE_BASE+7)
  86. // This tells the service to patch itself.
  87. #define VMPI_SERVICE_PATCH (VMPI_MESSAGE_BASE+8)
  88. // Sent back to the master via UDP to tell it if its job has started and ended.
  89. #define VMPI_NOTIFY_START_STATUS (VMPI_MESSAGE_BASE+9)
  90. #define VMPI_NOTIFY_END_STATUS (VMPI_MESSAGE_BASE+10)
  91. #define VMPI_FORCE_PASSWORD_CHANGE (VMPI_MESSAGE_BASE+11)
  92. // These states are sent from the service to the services browser.
  93. #define VMPI_STATE_IDLE 0
  94. #define VMPI_STATE_BUSY 1
  95. #define VMPI_STATE_PATCHING 2
  96. #define VMPI_STATE_DISABLED 3
  97. #define VMPI_STATE_SCREENSAVER_DISABLED 4
  98. #define VMPI_STATE_DOWNLOADING 5
  99. #endif // VMPI_DEFS_H