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.

76 lines
4.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #include "convar.h"
  5. #include "replay/shared_defs.h"
  6. #include "sv_replaycontext.h"
  7. // memdbgon must be the last include file in a .cpp file!!!
  8. #include "tier0/memdbgon.h"
  9. //----------------------------------------------------------------------------------------
  10. void OnFileserverHostnameChanged( IConVar *pVar, const char *pOldValue, float flOldValue )
  11. {
  12. ConVarRef var( pVar );
  13. if ( !var.IsValid() )
  14. return;
  15. if ( g_pServerReplayContext )
  16. {
  17. g_pServerReplayContext->UpdateFileserverIPFromHostname( var.GetString() );
  18. }
  19. else
  20. {
  21. Warning ( "Cannot set ConVar %s yet. Replay is not initialized.", var.GetName() );
  22. }
  23. }
  24. void OnFileserverProxyHostnameChanged( IConVar *pVar, const char *pOldValue, float flOldValue )
  25. {
  26. ConVarRef var( pVar );
  27. if ( !var.IsValid() )
  28. return;
  29. if ( g_pServerReplayContext )
  30. {
  31. g_pServerReplayContext->UpdateFileserverProxyIPFromHostname( var.GetString() );
  32. }
  33. else
  34. {
  35. Warning ( "Cannot set ConVar %s yet. Replay is not initialized.", var.GetName() );
  36. }
  37. }
  38. //----------------------------------------------------------------------------------------
  39. ConVar replay_name( "replay_name", "Replay", FCVAR_GAMEDLL, "Replay bot name" );
  40. ConVar replay_dofileserver_cleanup_on_start( "replay_dofileserver_cleanup_on_start", "1", FCVAR_GAMEDLL, "Cleanup any stale replay data (both locally and on fileserver) at startup." );
  41. //
  42. // FTP offloading
  43. //
  44. ConVar replay_fileserver_autocleanup( "replay_fileserver_autocleanup", "0", FCVAR_GAMEDLL, "Automatically do fileserver cleanup in between rounds? This is the same as explicitly calling replay_docleanup." );
  45. ConVar replay_fileserver_offload_aborttime( "replay_fileserver_offload_aborttime", "60", FCVAR_GAMEDLL, "The time after which publishing will be aborted for a session block or session info file.", true, 30.0f, true, 60.0f );
  46. //
  47. // For URL construction
  48. //
  49. ConVar replay_fileserver_protocol( "replay_fileserver_protocol", "http", FCVAR_REPLICATED | FCVAR_DONTRECORD, "Can be \"http\" or \"https\"" );
  50. ConVar replay_fileserver_host( "replay_fileserver_host", "", FCVAR_REPLICATED | FCVAR_DONTRECORD, "The hostname of the Web server hosting replays. This can be an IP or a hostname, e.g. \"1.2.3.4\" or \"www.myserver.com\"" );
  51. ConVar replay_fileserver_port( "replay_fileserver_port", "80", FCVAR_REPLICATED | FCVAR_DONTRECORD, "The port for the Web server hosting replays. For example, if your replays are stored at \"http://123.123.123.123:4567/tf/replays\", replay_fileserver_port should be 4567." );
  52. ConVar replay_fileserver_path( "replay_fileserver_path", "", FCVAR_REPLICATED | FCVAR_DONTRECORD, "If your replays are stored at \"http://123.123.123.123:4567/tf/replays\", replay_fileserver_path should be set to \"/tf/replays\"" );
  53. ConVar replay_max_publish_threads( "replay_max_publish_threads", "4", FCVAR_GAMEDLL, "The max number of threads allowed for publishing replay data, e.g. FTP threads.", true, 4, true, 8 );
  54. ConVar replay_block_dump_interval( "replay_block_dump_interval", "10", FCVAR_DONTRECORD, "The server will write partial replay files at this interval when recording.", true, MIN_SERVER_DUMP_INTERVAL, true, MAX_SERVER_DUMP_INTERVAL );
  55. ConVar replay_data_lifespan( "replay_data_lifespan", "1", FCVAR_REPLICATED | FCVAR_DONTRECORD, "The number of days before replay data will be removed from the server. Server operators can expect that any data written more than replay_data_lifespan days will be considered stale, and any subsequent execution of replay_docleanup (or automatic cleanup, which can be enabled with replay_fileserver_autocleanup) will remove that data.", true, 1, true, 30 );
  56. ConVar replay_local_fileserver_path( "replay_local_fileserver_path", "", FCVAR_DONTRECORD, "The file server local path. For example, \"c:\\MyWebServer\\htdocs\\replays\" or \"/MyWebServer/htdocs/replays\"." );
  57. ConVar replay_buffersize( "replay_buffersize", "32", FCVAR_DONTRECORD, "Maximum size for the replay memory buffer.", true, 16, false, 0 );
  58. ConVar replay_record_voice( "replay_record_voice", "1", FCVAR_GAMEDLL, "If enabled, voice data is recorded into the replay files." );
  59. //----------------------------------------------------------------------------------------