CServerFrameView.h
Upload User: bsw_2008
Upload Date: 2013-07-09
Package Size: 2446k
Code Size: 3k
Development Platform:

Visual C++

  1. // CServerFrameView.h : interface of the CCServerFrameView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_CSERVERFRAMEVIEW_H__77E02202_2828_44A0_B4CB_34ED28E0F3B3__INCLUDED_)
  5. #define AFX_CSERVERFRAMEVIEW_H__77E02202_2828_44A0_B4CB_34ED28E0F3B3__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CCServerFrameSet;
  10. #include "Server.h"
  11. #include <afxtempl.h>
  12. #include "ServerProtocol.h"
  13. #define SER_MESSAGE WM_USER + 100
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CServerFrameView
  16. typedef CList <SOCKET,SOCKET&> SOCKET_ARRAY;
  17. class CCServerFrameDoc;
  18. class CCServerFrameView : public CRecordView
  19. {
  20. typedef struct TT{
  21. int d[4];
  22. int ID[4];
  23. int board[17][17];
  24. BOOL begin[4];
  25. };
  26. typedef struct MM{
  27. CString name,sex;
  28. int score;
  29. };
  30. protected: // create from serialization only
  31. CCServerFrameView();
  32. DECLARE_DYNCREATE(CCServerFrameView)
  33. public:
  34. MM user[64];
  35. SOCKET_ARRAY m_connectionList;
  36. TT table[4][4];
  37. CServer m_server;
  38. //SOCKET_ARRAY m_connectionList;
  39. //{{AFX_DATA(CCServerFrameView)
  40. enum { IDD = IDD_CSERVERFRAME_FORM };
  41. CListCtrl m_OnlineList;
  42. CEdit m_output;
  43. CListCtrl m_UserList;
  44. CCServerFrameSet* m_pSet;
  45. CString m_sShowText;
  46. //}}AFX_DATA
  47. // Attributes
  48. public:
  49. CCServerFrameDoc* GetDocument();
  50. // Operations
  51. public:
  52. // Overrides
  53. // ClassWizard generated virtual function overrides
  54. //{{AFX_VIRTUAL(CCServerFrameView)
  55. public:
  56. virtual CRecordset* OnGetRecordset();
  57. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  58. protected:
  59. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  60. virtual void OnInitialUpdate(); // called first time after construct
  61. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  62. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  63. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  64. //}}AFX_VIRTUAL
  65. // Implementation
  66. public:
  67. virtual ~CCServerFrameView();
  68. #ifdef _DEBUG
  69. virtual void AssertValid() const;
  70. virtual void Dump(CDumpContext& dc) const;
  71. #endif
  72. protected:
  73. // Generated message map functions
  74. protected:
  75. void RecordModify(int i,int score);
  76. void dealloss(int desk,int direct);
  77. void play(int i);
  78. void GamerBegin(int i);
  79. POINT rotate(POINT original,int direct);
  80. void SendUserMessage(int i);
  81. void Leave(int i);
  82. void SitDown(int i);
  83. CString TableMessage();
  84. BOOL compare(CString s1,CString s2);
  85. void validate(int i);
  86. void RecordAddnew(int i);
  87. void ChatMessage(int i);
  88. void dealMessage(char k,int i);
  89. CServerProtocol protocol;
  90. BOOL m_bInit;
  91. void SetServer();
  92. afx_msg LRESULT OnServerMessage(WPARAM wParam, LPARAM lParam);
  93. //{{AFX_MSG(CCServerFrameView)
  94. // NOTE - the ClassWizard will add and remove member functions here.
  95. //    DO NOT EDIT what you see in these blocks of generated code !
  96. //}}AFX_MSG
  97. DECLARE_MESSAGE_MAP()
  98. };
  99. #ifndef _DEBUG  // debug version in CServerFrameView.cpp
  100. inline CCServerFrameDoc* CCServerFrameView::GetDocument()
  101.    { return (CCServerFrameDoc*)m_pDocument; }
  102. #endif
  103. /////////////////////////////////////////////////////////////////////////////
  104. //{{AFX_INSERT_LOCATION}}
  105. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  106. #endif // !defined(AFX_CSERVERFRAMEVIEW_H__77E02202_2828_44A0_B4CB_34ED28E0F3B3__INCLUDED_)