
// qqgame_wsclientDlg.h : header file
//

#pragma once

#include <xstring>

class game_websocket_client;

// Cqqgame_wsclientDlg dialog
class Cqqgame_wsclientDlg : public CDialogEx
{
// Construction
public:
	Cqqgame_wsclientDlg(CWnd* pParent, std::wstring id, std::wstring key, std::wstring pfkey, std::wstring port);	// standard constructor

// Dialog Data
	enum { IDD = IDD_QQGAME_WSCLIENT_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButton1();
	afx_msg void OnBnClickedButton2();
	afx_msg void OnLbnSelchangeList1();
	afx_msg void OnEnChangeEdit4();
	afx_msg void OnBnClickedButton4();

private:
	void connect_ws();

	void on_ws_connect(bool succ);
	void on_ws_recieve(const std::string& data);
	void on_ws_broken();

private:
	std::wstring m_hall_id;
	std::wstring m_hall_key;
	std::wstring m_hall_pfkey;
	std::wstring m_hall_port;

	std::shared_ptr<game_websocket_client> m_game_ws;
public:
	afx_msg void OnEnChangeEdit3();
	afx_msg void OnBnClickedButton3();
	afx_msg void OnBnClickedButton6();
};
