summaryrefslogtreecommitdiff
path: root/utils/vmpi/net_view_thread.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vmpi/net_view_thread.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/vmpi/net_view_thread.h')
-rw-r--r--utils/vmpi/net_view_thread.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/utils/vmpi/net_view_thread.h b/utils/vmpi/net_view_thread.h
new file mode 100644
index 0000000..4de4406
--- /dev/null
+++ b/utils/vmpi/net_view_thread.h
@@ -0,0 +1,45 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef NET_VIEW_THREAD_H
+#define NET_VIEW_THREAD_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "utlvector.h"
+
+
+class CNetViewThread
+{
+public:
+ CNetViewThread();
+ ~CNetViewThread();
+
+ // This creates the thread that periodically checks "net view" to get the current list of
+ // machines out on the network.
+ void Init();
+ void Term();
+
+ void GetComputerNames( CUtlVector<char*> &computerNames );
+
+private:
+
+ void UpdateServicesFromNetView();
+ void ParseComputerNames( const char *pNetViewOutput );
+
+ DWORD ThreadFn();
+ static DWORD WINAPI StaticThreadFn( LPVOID lpParameter );
+
+ CUtlVector<char*> m_ComputerNames;
+ HANDLE m_hThread;
+ HANDLE m_hThreadExitEvent;
+ CRITICAL_SECTION m_ComputerNamesCS;
+};
+
+
+#endif // NET_VIEW_THREAD_H