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

📄 setdownloadpathdlg.cpp

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

#include "stdafx.h"
#include "rmtool.h"
#include "SetDownloadPathDlg.h"
#include "Packet.h"
#include "ServerView.h"


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

/////////////////////////////////////////////////////////////////////////////
// CSetDownloadPathDlg dialog


CSetDownloadPathDlg::CSetDownloadPathDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSetDownloadPathDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetDownloadPathDlg)
	m_szPath = _T("");
	m_szExePath = _T("");
	m_szListenerCopyPath = _T("");
	//}}AFX_DATA_INIT
}


void CSetDownloadPathDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetDownloadPathDlg)
	DDX_Control(pDX, IDC_EXE_DRIVE, c_ExeDrive);
	DDX_Control(pDX, IDC_COMBO, c_Combo);
	DDX_Control(pDX, IDC_EDIT_PATH, c_Path);
	DDX_Text(pDX, IDC_EDIT_PATH, m_szPath);
	DDX_Text(pDX, IDC_EXE_PATH, m_szExePath);
	DDX_Text(pDX, IDC_LISTENER_EXE_PATH, m_szListenerCopyPath);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSetDownloadPathDlg, CDialog)
	//{{AFX_MSG_MAP(CSetDownloadPathDlg)
	ON_WM_LBUTTONDOWN()
	ON_BN_CLICKED(IDC_APPLY_PATH, OnApplyPath)
	ON_BN_CLICKED(IDC_APPLY_LISTENER_PATH, OnApplyListenerPath)
	ON_BN_CLICKED(IDC_APPLY_SERVER_UPLOAD_PATH, OnApplyServerUploadPath)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSetDownloadPathDlg message handlers

BOOL CSetDownloadPathDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_pApp = (CRMToolApp*)AfxGetApp();
	
	c_Combo.InsertString(0,"C:\\");
	c_Combo.InsertString(1,"D:\\");
	c_Combo.InsertString(2,"E:\\");
	c_Combo.InsertString(3,"F:\\");
	c_ExeDrive.InsertString(0,"C:\\");
	c_ExeDrive.InsertString(1,"D:\\");
	c_ExeDrive.InsertString(2,"E:\\");
	c_ExeDrive.InsertString(3,"F:\\");

	CString szTemp, szTemp2;
	szTemp = m_pApp->m_szDownloadPath[ m_nCurServerSet ];

	//Drive 巩磊 惶酒晨 
	szTemp2 = szTemp.GetAt(0);
	szTemp2.MakeUpper();
	//int z  = (szTemp2.GetBuffer(0) - "C");
	//c_Combo.SetCurSel( "C" - szTemp2.GetBuffer(0));
	
	if(szTemp2 == "C")
		c_Combo.SetCurSel(0);
	else if(szTemp2 == "D")
		c_Combo.SetCurSel(1);
	else if(szTemp2 == "E")
		c_Combo.SetCurSel(2);
	else if(szTemp2 == "F")
		c_Combo.SetCurSel(3);


	
	szTemp2 = szTemp.Mid(3);	//版肺 惶酒晨 
	m_szPath = szTemp2;			//Download Path

	
	//GameServerData Path 惶酒晨 
	szTemp = m_pApp->m_szUploadPath;
	szTemp2 = szTemp.GetAt(0);
	szTemp2.MakeUpper();

	if(szTemp2 == "C")
		c_ExeDrive.SetCurSel(0);
	else if(szTemp2 == "D")
		c_ExeDrive.SetCurSel(1);
	else if(szTemp2 == "E")
		c_ExeDrive.SetCurSel(2);
	else if(szTemp2 == "F")
		c_ExeDrive.SetCurSel(3);
	szTemp2 = szTemp.Mid(3);
	m_szExePath = szTemp2;

	
	
	
	char temp[0xff];
	SetDlgItemText(IDC_EXE_MACHINE, m_pApp->m_szGameServerDataIp); //弊成 IP
	sprintf(temp,"\\\\%s\\",m_pApp->m_szServerExecAddress);
	SetDlgItemText(IDC_EXE_MACHINE2, temp);			//匙飘亏惑 版肺 \\嘿篮芭 
	
	if( m_szListenerCopyPath.GetLength() <= 0 )
		m_szListenerCopyPath = "ServerExec";

	UpdateData(FALSE);
	c_Path.SetFocus();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSetDownloadPathDlg::OnOK() 
{
	// TODO: Add extra validation here

	CDialog::OnOK();
}

void CSetDownloadPathDlg::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	PostMessage (WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x,point.y));
	CDialog::OnLButtonDown(nFlags, point);
}

void CSetDownloadPathDlg::OnApplyPath() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	char drive=' ';
	switch( c_Combo.GetCurSel() )
	{
	case 0: drive = 'C';break;
	case 1: drive = 'D';break;
	case 2: drive = 'E';break;
	case 3: drive = 'F';break;
	}
/*
	if(c_Combo.GetCurSel())
		drive = 'D';
	else 
		drive = 'C';
*/
	
	sprintf(m_pApp->m_szDownloadPath[ m_nCurServerSet ],"%c:\\%s",drive,m_szPath);

	//memset(m_pApp->m_szDownloadPath,0,sizeof(m_pApp->m_szDownloadPath));
	//memcpy(m_pApp->m_szDownloadPath, m_szPath.GetBuffer( m_szPath.GetLength() ), m_szPath.GetLength()  

//	CServerView *pView = (CServerView*)m_pPatchDlg->GetParent();
	
	
//	m_pPatchDlg->m_szDownloadPath.szDrive = drive;		//ServerPatch View俊档 版肺 扁撅秦 初绊..
//	memset(m_pPatchDlg->m_szDownloadPath.szPath ,0,sizeof(m_pPatchDlg->m_szDownloadPath.szPath ));
//	memcpy(m_pPatchDlg->m_szDownloadPath.szPath , m_szPath.GetBuffer( m_szPath.GetLength() ), m_szPath.GetLength());
	
	
//	PACKET_SET_DOWNLOAD_PATH packet(drive, m_szPath.GetBuffer(m_szPath.GetLength()));
//	g_pNet->Send(pApp->m_nCI[ pView->m_nCurServerSet ], (char*)&packet, packet.GetPacketSize());
}

void CSetDownloadPathDlg::OnApplyListenerPath() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	char str[ 0xff ];
	char ip[ 64 ];
	GetDlgItemText(IDC_EXE_MACHINE2, ip, 64);
	sprintf(str, "%s%s", ip, m_szListenerCopyPath);

	//m_pPatchDlg->m_szDownloadPath = m_szPath;		//ServerPatch View俊档 版肺 扁撅秦 初绊..
	PACKET_SET_COPY_PATH packet( str );
	g_pNet->Send(m_pApp->m_nCI[ m_nCurServerSet ], (char*)&packet, packet.GetPacketSize());
	
}

void CSetDownloadPathDlg::OnApplyServerUploadPath() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	char drive;
	if(c_ExeDrive.GetCurSel())
		drive = 'D';
	else 
		drive = 'C';

	sprintf(m_pApp->m_szUploadPath, "%c:\\%s", drive, m_szExePath);

//	CServerView *pView = (CServerView*)m_pPatchDlg->GetParent();
//	CRMToolApp *pApp = (CRMToolApp*)AfxGetApp();
//	m_pPatchDlg->m_szUploadPath.szDrive = drive;			//ServerPatch View俊档 版肺 扁撅秦 初绊..
//	memset(m_pPatchDlg->m_szUploadPath.szPath,0,sizeof(m_pPatchDlg->m_szUploadPath.szPath));
//	memcpy(m_pPatchDlg->m_szUploadPath.szPath , m_szExePath.GetBuffer( m_szExePath.GetLength() ), m_szExePath.GetLength());

//	PACKET_SET_DOWNLOAD_PATH packet(drive, m_szPath.GetBuffer(m_szPath.GetLength()));
//	g_pNet->Send(pApp->m_nCI[ pView->m_nCurServerSet ], (char*)&packet, packet.GetPacketSize());	
}






⌨️ 快捷键说明

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