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.

100 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // MessageWatchDlg.h : header file
  9. //
  10. #if !defined(AFX_MESSAGEWATCHDLG_H__AB9CEAF4_0166_4CCA_9DEC_77C0918F78C4__INCLUDED_)
  11. #define AFX_MESSAGEWATCHDLG_H__AB9CEAF4_0166_4CCA_9DEC_77C0918F78C4__INCLUDED_
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif // _MSC_VER > 1000
  15. #include "iphelpers.h"
  16. #include "tcpsocket.h"
  17. #include "threadhelpers.h"
  18. #include "consolewnd.h"
  19. #include "win_idle.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CMessageWatchDlg dialog
  22. class CSender
  23. {
  24. public:
  25. CSender();
  26. ~CSender();
  27. public:
  28. CIPAddr m_Addr;
  29. ITCPSocket *m_pSocket;
  30. IConsoleWnd *m_pConsoleWnd;
  31. char m_Name[128];
  32. };
  33. class CMessageWatchDlg : public CDialog
  34. {
  35. // Construction
  36. public:
  37. CMessageWatchDlg(CWnd* pParent = NULL); // standard constructor
  38. ~CMessageWatchDlg();
  39. // Listen for broadcasts on this socket.
  40. ISocket *m_pListenSocket;
  41. // Connections we've made.
  42. CUtlLinkedList<CSender*,int> m_Senders;
  43. CCriticalSection m_SocketsCS;
  44. CWinIdle m_cWinIdle;
  45. CSender* FindSenderByAddr( const unsigned char ip[4] );
  46. CSender* FindSenderByName( const char *pName );
  47. // Dialog Data
  48. //{{AFX_DATA(CMessageWatchDlg)
  49. enum { IDD = IDD_MESSAGEWATCH_DIALOG };
  50. CListBox m_Machines;
  51. //}}AFX_DATA
  52. // ClassWizard generated virtual function overrides
  53. //{{AFX_VIRTUAL(CMessageWatchDlg)
  54. protected:
  55. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. protected:
  59. HICON m_hIcon;
  60. void OnIdle();
  61. // Generated message map functions
  62. //{{AFX_MSG(CMessageWatchDlg)
  63. afx_msg void OnDestroy();
  64. afx_msg LONG OnStartIdle(UINT, LONG);
  65. virtual BOOL OnInitDialog();
  66. afx_msg void OnPaint();
  67. afx_msg HCURSOR OnQueryDragIcon();
  68. afx_msg void OnDblclkMachines();
  69. afx_msg void OnShowall();
  70. afx_msg void OnHideall();
  71. //}}AFX_MSG
  72. DECLARE_MESSAGE_MAP()
  73. };
  74. //{{AFX_INSERT_LOCATION}}
  75. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  76. #endif // !defined(AFX_MESSAGEWATCHDLG_H__AB9CEAF4_0166_4CCA_9DEC_77C0918F78C4__INCLUDED_)