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.

45 lines
913 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef NET_VIEW_THREAD_H
  7. #define NET_VIEW_THREAD_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "utlvector.h"
  12. class CNetViewThread
  13. {
  14. public:
  15. CNetViewThread();
  16. ~CNetViewThread();
  17. // This creates the thread that periodically checks "net view" to get the current list of
  18. // machines out on the network.
  19. void Init();
  20. void Term();
  21. void GetComputerNames( CUtlVector<char*> &computerNames );
  22. private:
  23. void UpdateServicesFromNetView();
  24. void ParseComputerNames( const char *pNetViewOutput );
  25. DWORD ThreadFn();
  26. static DWORD WINAPI StaticThreadFn( LPVOID lpParameter );
  27. CUtlVector<char*> m_ComputerNames;
  28. HANDLE m_hThread;
  29. HANDLE m_hThreadExitEvent;
  30. CRITICAL_SECTION m_ComputerNamesCS;
  31. };
  32. #endif // NET_VIEW_THREAD_H