⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kickoffdlg.cpp

📁 网络游戏龙族服务器端管理工具 rmtool 源代码
💻 CPP
字号:
// KickOffDlg.cpp : implementation file
//

#include "stdafx.h"
#include "rmtool.h"
#include "KickOffDlg.h"
#include "Packet.h"
//#include "ServerPatch.h"
#include "ServerView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKickOffDlg dialog
// BBD 040107
// 荤侩磊 傈盔阑 郴焊郴扁困茄 促捞倔肺弊

CKickOffDlg::CKickOffDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CKickOffDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CKickOffDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_bUseTimer = false;
	m_pApp = 0L;
	m_pView = 0L;
}

CKickOffDlg::~CKickOffDlg()
{
	m_pApp = 0L;
	m_pView = 0L;

	if(m_bUseTimer)	// 鸥捞赣啊 荤侩吝捞搁 掺磊
	{
		KillTimer(1);
		m_bUseTimer = false;
	}
}

void CKickOffDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CKickOffDlg)
	DDX_Control(pDX, IDC_JOINMAP_BTN, m_ctrlBtnJoinmap);
	DDX_Control(pDX, IDC_KICKOFF_ALL_BTN, m_ctrlBtnKickOff);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CKickOffDlg, CDialog)
	//{{AFX_MSG_MAP(CKickOffDlg)
	ON_BN_CLICKED(IDC_KICKOFF_ALL_BTN, OnKickoffAllBtn)
	ON_WM_TIMER()
	ON_WM_PAINT()
	ON_BN_CLICKED(IDC_JOINMAP_BTN, OnJoinmapBtn)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKickOffDlg message handlers

void CKickOffDlg::OnKickoffAllBtn() 
{
	// TODO: Add your control notification handler code here
	m_pApp = (CRMToolApp*)AfxGetApp();
//	m_pParent = (CServerPatch * ) GetParent();
	if(!m_pApp || !m_pView)
	{
		return;
	}

	PACKET_KICKOFF_USERALL packet;
	packet.bPtcl = PTCL_RM;
	packet.bHeader = MSG_RM_KICKOFF_USER_ALL;
	
	g_pNet->Send(m_pApp->m_nCI[ m_pView->m_nCurServerSet ],  (char*)&packet,  2);

	SetTimer(1, GetDlgItemInt(IDC_EDIT_KICKOFF_INTERVAL) * 1000, 0);
	m_ctrlBtnKickOff.EnableWindow(FALSE);
	m_bUseTimer = true;
}

BOOL CKickOffDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

//	CMainFame *pFrame = (CMainFame *)AfxGetMainWnd(); 
//	CSDIView *pView = (CSDIView *)pFrame->GetActiveView(); 
//	m_pView = (CServerView*) ((CServerPatch * )GetParent())->m_pView;

	SetDlgItemInt(IDC_EDIT_KICKOFF_INTERVAL, 1);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CKickOffDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
//	MessageBox("asdg");

	if(!m_pApp || !m_pView || !m_bUseTimer)
	{
		return;
	}

	PACKET_KICKOFF_USERALL packet;
	packet.bPtcl = PTCL_RM;
	packet.bHeader = MSG_RM_KICKOFF_USER_SEVERAL;
	
	g_pNet->Send(m_pApp->m_nCI[ m_pView->m_nCurServerSet ],  (char*)&packet,  2);

	SetTimer(1, GetDlgItemInt(IDC_EDIT_KICKOFF_INTERVAL) * 1000, 0);
	m_bUseTimer = true;
	
	CDialog::OnTimer(nIDEvent);
}

void CKickOffDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
		
	// Do not call CDialog::OnPaint() for painting messages
}

void CKickOffDlg::OnJoinmapBtn() 
{
	// TODO: Add your control notification handler code here
	PACKET_KICKOFF_AGENTCANJOIN packet;
	packet.bPtcl = PTCL_RM;
	packet.bHeader = MSG_RM_KICKOFF_AGENTCANJOIN;
	
	g_pNet->Send(m_pApp->m_nCI[ m_pView->m_nCurServerSet ],  (char*)&packet,  2);

	if(m_bUseTimer)
	{
		KillTimer(1);
		m_bUseTimer = false;
		m_ctrlBtnKickOff.EnableWindow(TRUE);
	}
}

void CKickOffDlg::OnOK() 
{
	// TODO: Add extra validation here
	// OK 滚瓢阑 穿福搁 葛电 青悼阑 吝窜窍绊 肺弊牢俊 瘤厘捞 绝档废 父电促
	OnJoinmapBtn();	
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -