Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
290
Server/ManageTool/MonitoringTool/MonitoringToolDlg.cpp
Normal file
290
Server/ManageTool/MonitoringTool/MonitoringToolDlg.cpp
Normal file
@@ -0,0 +1,290 @@
|
||||
// MonitoringToolDlg.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MonitoringTool.h"
|
||||
#include "MonitoringToolDlg.h"
|
||||
#include "LoginDlg.h"
|
||||
#include "MonitoringSheet.h"
|
||||
#include "ChatServerEventHandler.h"
|
||||
#include "ManagerServerEventHandler.h"
|
||||
#include "GlobalFunc.h"
|
||||
#include "MonitoringToolLog.h"
|
||||
|
||||
#include <Network/ClientNetwork/SessionMgr.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
#include ".\monitoringtooldlg.h"
|
||||
|
||||
static UINT_PTR IID_PROCESS_SOCKET = 1;
|
||||
static UINT_PTR IID_USERSTAT_CHECK = 2; ///< <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD>ID
|
||||
static UINT_PTR IID_CONNECTION_CHECK = 3; ///< ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD>ID
|
||||
static UINT_PTR IID_PING_CHECK = 4; ///< <20><> üũ <20><EFBFBD><DEBC><EFBFBD>ID
|
||||
|
||||
const int MAXIMUM_PING_WAIT_TIME = 1000 * 60 * 2; ///< <20>ִ<EFBFBD> <20><> üũ <20>ֱ<EFBFBD>(2<><32><EFBFBD>̻<EFBFBD> <20><> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
|
||||
class CProcessChaServerHandlerPing
|
||||
{
|
||||
public:
|
||||
|
||||
CProcessChaServerHandlerPing(unsigned long dwCurrentTime)
|
||||
: m_dwCurrentTime(dwCurrentTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void operator() (unsigned int nServerID, ClientNet::CChatServerEventHandler* lpHandler)
|
||||
{
|
||||
if (MAXIMUM_PING_WAIT_TIME < m_dwCurrentTime - lpHandler->GetLastPingRecvTime())
|
||||
{
|
||||
theApp.GetEventHandlerMgr().Close(lpHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned long m_dwCurrentTime;
|
||||
};
|
||||
|
||||
|
||||
void CALLBACK Process(HWND hWnd, UINT nMsg, UINT_PTR nTimerID, DWORD dwTime)
|
||||
{
|
||||
if(IID_PROCESS_SOCKET == nTimerID)
|
||||
{
|
||||
theApp.GetEventHandlerMgr().HandleEvents(1000);
|
||||
}
|
||||
else if(IID_CONNECTION_CHECK == nTimerID)
|
||||
{
|
||||
CChattingPage* lpChattingPage =
|
||||
static_cast<CChattingPage*>(theApp.GetRegisteredWindow(IDD_CHATTINGPAGE));
|
||||
|
||||
if(NULL != lpChattingPage)
|
||||
{
|
||||
// ä<>ü<EFBFBD><C3BC><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ǥ<><C7A5>
|
||||
SetConnectionListBox(lpChattingPage->m_ctrlConnectionList);
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ǥ<><C7A5>
|
||||
lpChattingPage->SetManagerServerConnection();
|
||||
}
|
||||
}
|
||||
else if(IID_PING_CHECK == nTimerID)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> Ping<6E><67> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
unsigned long dwCurrentTime = timeGetTime();
|
||||
|
||||
ClientNet::CManagerServerEventHandler* lpManageServerEventHandler = theApp.GetManagerHandler();
|
||||
if (0 != lpManageServerEventHandler &&
|
||||
MAXIMUM_PING_WAIT_TIME < dwCurrentTime - lpManageServerEventHandler->GetLastPingRecvTime())
|
||||
{
|
||||
theApp.GetEventHandlerMgr().Close(lpManageServerEventHandler);
|
||||
}
|
||||
|
||||
theApp.EnumChatServerHandler(CProcessChaServerHandlerPing(dwCurrentTime));
|
||||
}
|
||||
else if(IID_USERSTAT_CHECK == nTimerID)
|
||||
{
|
||||
CChattingPage* lpChattingPage =
|
||||
static_cast<CChattingPage*>(theApp.GetRegisteredWindow(IDD_CHATTINGPAGE));
|
||||
|
||||
if(NULL != lpChattingPage)
|
||||
{
|
||||
lpChattingPage->SetUserStat();
|
||||
CMonitoringToolLog::GetInstance().WriteUserStatLog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CMonitoringToolDlg <20><>ȭ <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
IMPLEMENT_DYNAMIC(CMonitoringToolDlg, CDialog)
|
||||
CMonitoringToolDlg::CMonitoringToolDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMonitoringToolDlg::IDD, pParent)
|
||||
{
|
||||
theApp.RegisterWindow(IDD_MONITORINGTOOLDLG, static_cast<CWnd*>(this));
|
||||
}
|
||||
|
||||
CMonitoringToolDlg::~CMonitoringToolDlg()
|
||||
{
|
||||
if(NULL != m_pMonitoringSheet)
|
||||
{
|
||||
delete m_pMonitoringSheet;
|
||||
}
|
||||
if(NULL != m_pFilterUser)
|
||||
{
|
||||
delete m_pFilterUser;
|
||||
}
|
||||
if(NULL != m_pGMReport)
|
||||
{
|
||||
delete m_pGMReport;
|
||||
}
|
||||
|
||||
|
||||
|
||||
theApp.RemoveWindow(IDD_MONITORINGTOOLDLG);
|
||||
}
|
||||
|
||||
void CMonitoringToolDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_REPORT_LIST, m_ctrlReportList);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMonitoringToolDlg, CDialog)
|
||||
ON_BN_CLICKED(IDC_AUTH_BTN, OnBnClickedAuthBtn)
|
||||
ON_MESSAGE(WM_SHOW_MSGBOX, OnShowMessageBox)
|
||||
ON_WM_SIZE()
|
||||
ON_WM_SIZING()
|
||||
ON_BN_CLICKED(IDC_FILTER_BTN, OnBnClickedFilterBtn)
|
||||
ON_BN_CLICKED(IDC_REPORT_BTN, OnBnClickedReportBtn)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CMonitoringToolDlg <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
BOOL CMonitoringToolDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
SetTimer(IID_PROCESS_SOCKET, 200, Process);
|
||||
SetTimer(IID_USERSTAT_CHECK, 1500, Process);
|
||||
SetTimer(IID_CONNECTION_CHECK, 1000, Process);
|
||||
SetTimer(IID_PING_CHECK, 9000, Process);
|
||||
|
||||
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_SHEETHOLDER_PIC);
|
||||
// WS_EX_CONTROLPARENT <20>Ӽ<EFBFBD><D3BC><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>찡 <20><><EFBFBD><EFBFBD>
|
||||
pwndPropSheetHolder->ModifyStyleEx(0, WS_EX_CONTROLPARENT);
|
||||
|
||||
CRect rectPropSheet; pwndPropSheetHolder->GetWindowRect(rectPropSheet);
|
||||
|
||||
m_pMonitoringSheet = new CMonitoringSheet(_T("Chatting"), pwndPropSheetHolder);
|
||||
if(!m_pMonitoringSheet->Create(pwndPropSheetHolder, WS_CHILD | WS_VISIBLE, 0))
|
||||
{
|
||||
delete m_pMonitoringSheet;
|
||||
m_pMonitoringSheet = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
m_pMonitoringSheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
m_pMonitoringSheet->SetWindowPos(NULL, 0, 0, rectPropSheet.Width(), rectPropSheet.Height(),
|
||||
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
|
||||
SetDlgItemText(IDC_STRING018_STATIC, GetMyINIString("LOCAL_STRING", "STRING_018"));
|
||||
SetDlgItemText(IDC_AUTH_BTN, GetMyINIString("LOCAL_STRING", "STRING_019"));
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ä<>ü<EFBFBD><C3BC><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
ClientNet::CManagerServerEventHandler::Connect();
|
||||
ClientNet::CChatServerEventHandler::Connect();
|
||||
|
||||
m_pFilterUser = new CFilterUserDialog(this);
|
||||
m_pFilterUser->Create(IDD_FILTERDIALOG);
|
||||
|
||||
m_pGMReport = new CGMReportDialog(this);
|
||||
m_pGMReport->Create(IDD_GMREPORTDIALOG);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CMonitoringToolDlg::OnBnClickedAuthBtn()
|
||||
{
|
||||
CLoginDlg dlg(CLoginDlg::CHAT_SERVER);
|
||||
dlg.DoModal();
|
||||
}
|
||||
|
||||
void CMonitoringToolDlg::ReportWorkResult(const char* szMsg)
|
||||
{
|
||||
m_ctrlReportList.InsertString(m_ctrlReportList.GetCount(), szMsg);
|
||||
m_ctrlReportList.SetTopIndex(m_ctrlReportList.GetCount() - 4);
|
||||
}
|
||||
|
||||
LRESULT CMonitoringToolDlg::OnShowMessageBox(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
/*
|
||||
switch(wParam)
|
||||
{
|
||||
case MSGBOX_MANAGER_DISCONNECTED:
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><EFBFBD><DEBD><EFBFBD><EFBFBD>ڽ<EFBFBD> ǥ<><C7A5> : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
AfxMessageBox(GetMyINIString("LOCAL_STRING", "STRING_020"), MB_OK);z
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
void CMonitoringToolDlg::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CDialog::OnSize(nType, cx, cy);
|
||||
|
||||
CRect rect, rectc;
|
||||
GetClientRect(rect);
|
||||
|
||||
CWnd* pwndStatic = GetDlgItem(IDC_STRING018_STATIC);
|
||||
pwndStatic->GetWindowRect(rectc);
|
||||
pwndStatic->MoveWindow(rect.left+10, rect.bottom-70, rectc.Width(), rectc.Height());
|
||||
|
||||
CWnd* pwndAuth = GetDlgItem(IDC_AUTH_BTN);
|
||||
pwndAuth->GetWindowRect(rectc);
|
||||
pwndAuth->MoveWindow(rect.right-rectc.Width()-10, rect.bottom-80, rectc.Width(), rectc.Height());
|
||||
|
||||
CWnd* pwndFilter = GetDlgItem(IDC_FILTER_BTN);
|
||||
pwndFilter->GetWindowRect(rectc);
|
||||
pwndFilter->MoveWindow(rect.right-rectc.Width()-10, rect.bottom-55, rectc.Width(), rectc.Height());
|
||||
|
||||
CWnd* pwndReport = GetDlgItem(IDC_REPORT_BTN);
|
||||
pwndReport->GetWindowRect(rectc);
|
||||
pwndReport->MoveWindow(rect.right-rectc.Width()-10, rect.bottom-30, rectc.Width(), rectc.Height());
|
||||
|
||||
m_ctrlReportList.GetWindowRect(rectc);
|
||||
m_ctrlReportList.MoveWindow(rect.left+170, rect.bottom-70, rect.Width()-450, rectc.Height());
|
||||
|
||||
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_SHEETHOLDER_PIC);
|
||||
pwndPropSheetHolder->GetWindowRect(rectc);
|
||||
pwndPropSheetHolder->MoveWindow(rect.left+10, rect.top+10, rect.Width()-20, rect.Height()-95);
|
||||
if(m_pMonitoringSheet)
|
||||
{
|
||||
pwndPropSheetHolder->GetClientRect(rectc);
|
||||
m_pMonitoringSheet->MoveWindow(rectc);
|
||||
}
|
||||
|
||||
// m_pMonitoringSheet->SetWindowPos(NULL, 0, 0, rectPropSheet.Width(), rectPropSheet.Height(),
|
||||
/*
|
||||
m_pMonitoringSheet = new CMonitoringSheet(_T("Chatting"), pwndPropSheetHolder);
|
||||
if(!m_pMonitoringSheet->Create(pwndPropSheetHolder, WS_CHILD | WS_VISIBLE, 0))
|
||||
{
|
||||
delete m_pMonitoringSheet;
|
||||
m_pMonitoringSheet = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
m_pMonitoringSheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
|
||||
SetDlgItemText(IDC_STRING018_STATIC, GetMyINIString("LOCAL_STRING", "STRING_018"));
|
||||
SetDlgItemText(IDC_AUTH_BTN, GetMyINIString("LOCAL_STRING", "STRING_019"));
|
||||
*/
|
||||
// TODO: <20><><EFBFBD> <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
||||
}
|
||||
|
||||
void CMonitoringToolDlg::OnBnClickedFilterBtn()
|
||||
{
|
||||
// TODO: <20><><EFBFBD> <20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
||||
if(m_pFilterUser)
|
||||
{
|
||||
if(m_pFilterUser->IsWindowVisible())
|
||||
m_pFilterUser->ShowWindow(SW_HIDE);
|
||||
else
|
||||
m_pFilterUser->ShowWindow(SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
void CMonitoringToolDlg::OnBnClickedReportBtn()
|
||||
{
|
||||
// TODO: <20><><EFBFBD> <20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
||||
if(m_pGMReport)
|
||||
{
|
||||
if(m_pGMReport->IsWindowVisible())
|
||||
m_pGMReport->ShowWindow(SW_HIDE);
|
||||
else
|
||||
m_pGMReport->ShowWindow(SW_SHOW);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user