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.

121 lines
3.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Expose functions from sv_main.cpp.
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef SV_MAIN_H
  8. #define SV_MAIN_H
  9. #include "edict.h"
  10. #include "packed_entity.h"
  11. #include "utlvector.h"
  12. #include "convar.h"
  13. #include "netadr.h"
  14. #include "checksum_crc.h"
  15. #include "soundflags.h"
  16. #include "tier1/bitbuf.h"
  17. class CGameClient;
  18. //===========================================================
  19. // sv_main.c
  20. // Which areas are we going to transmit (usually 1, but with portals you can see into multiple other areas).
  21. extern CUtlVector<int> g_AreasNetworked;
  22. void SV_Frame( bool send_client_updates );
  23. void SV_FrameExecuteThreadDeferred();
  24. void SV_InitGameDLL( void );
  25. void SV_ReplicateConVarChange( ConVar const *var, char const *newValue );
  26. void SV_ExecuteRemoteCommand( const char *pCommand, int nClientSlot = -1 );
  27. void SV_InstallClientStringTableMirrors( void );
  28. void SV_ResetModInfo( void );
  29. class IRecipientFilter;
  30. void SV_StartSound ( IRecipientFilter& filter, edict_t *pSoundEmittingEntity, int iChannel, const char *pSample,
  31. float flVolume, soundlevel_t iSoundLevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin, float soundtime, int speakerentity, CUtlVector< Vector >* pUtlVecOrigins );
  32. int SV_ModelIndex (const char *name);
  33. int SV_FindOrAddModel (const char *name, bool preload );
  34. int SV_SoundIndex (const char *name);
  35. int SV_FindOrAddSound(const char *name, bool preload );
  36. int SV_GenericIndex(const char *name);
  37. int SV_FindOrAddGeneric(const char *name, bool preload );
  38. int SV_DecalIndex(const char *name);
  39. int SV_FindOrAddDecal(const char *name, bool preload );
  40. void SV_ForceSimpleMaterial( const char *name );
  41. void SV_ForceModelBounds( const char *name, const Vector &mins, const Vector &maxs );
  42. void SV_Physics( bool bIsSimulating );
  43. void SV_PreClientUpdate( bool bIsSimulating );
  44. class IServerEntity;
  45. void SV_ExecuteClientMessage (CGameClient *cl);
  46. bool SV_ActivateServer();
  47. void SV_InitGameServerSteam();
  48. #ifdef ENABLE_RPT
  49. void SV_NotifyRPTOfDisconnect( int nClientSlot );
  50. #endif // ENABLE_RPT
  51. // sv_redirect.cpp
  52. enum redirect_t
  53. {
  54. RD_NONE = 0, // server console
  55. RD_CLIENT, // client console
  56. RD_PACKET, // connectionless UDP
  57. RD_SOCKET // TCP/IP remote socket
  58. };
  59. bool SV_RedirectActive( void );
  60. void SV_RedirectAddText( const char *txt );
  61. void SV_RedirectStart( redirect_t rd, const netadr_t *addr );
  62. void SV_RedirectEnd( void );
  63. class ServerClass;
  64. class IClient;
  65. class CClientFrame;
  66. // Builds an alternate copy of the datatable for any classes that have datatables with props excluded.
  67. void SV_InitSendTables( ServerClass *pClasses );
  68. void SV_TermSendTables( ServerClass *pClasses );
  69. // send voice data from cl to other clients
  70. void SV_BroadcastVoiceData(IClient * cl, int nBytes, char * data, int64 xuid);
  71. void SV_SendRestoreMsg( bf_write &dest );
  72. // A client has uploaded its logo to us;
  73. void SV_SendLogo( CRC32_t& logoCRC );
  74. void SV_PruneRequestList( void );
  75. /*
  76. =============
  77. Calculates a PVS that is the inclusive or of all leafs within 8 pixels of the
  78. given point.
  79. =============
  80. */
  81. void SV_ResetPVS( byte* pvs, int pvssize );
  82. void SV_AddOriginToPVS( const Vector& origin );
  83. extern CGlobalVars g_ServerGlobalVariables;
  84. void SV_FlushMemoryOnNextServer();
  85. #endif