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:
220
Server/NFAuthTool/NFAuthServer/NaveServer/UIFramework.h
Normal file
220
Server/NFAuthTool/NFAuthServer/NaveServer/UIFramework.h
Normal file
@@ -0,0 +1,220 @@
|
||||
/**
|
||||
* @file UIFramework.h
|
||||
* @brief Server<65><72> ȭ<><C8AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> UIFramework <20><>ü
|
||||
* @remarks
|
||||
* @author <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(edith2580@gmail.com)
|
||||
* @date 2009-05-09
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "UICmdEdit.h"
|
||||
#include "UICmdMsgView.h"
|
||||
#include <vector>
|
||||
|
||||
namespace NaveServer {
|
||||
|
||||
/// <20><><EFBFBD>ο<EFBFBD> Ŀ<>ǵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
||||
/// ADD_COMMAND(_T("help"), CCmdHelp, L"ȭ<>鿡 Ŀ<><C4BF><EFBFBD>帮<EFBFBD><E5B8AE>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>ݴϴ<DDB4>.");
|
||||
#define ADD_COMMAND(cmd, object, msg) AddCommand(cmd, new object, msg)
|
||||
|
||||
/**
|
||||
* @class UICommand
|
||||
* @brief <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>̼ǿ<CCBC><C7BF><EFBFBD> Ŀ<>ǵ带 <20>ۼ<EFBFBD><DBBC>Ҷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŀ<><C4BF><EFBFBD><EFBFBD> <20><>ü
|
||||
* @remarks
|
||||
*
|
||||
* @par
|
||||
* @author Edith
|
||||
* @date 2009-05-09
|
||||
*/
|
||||
class UICommand
|
||||
{
|
||||
public:
|
||||
virtual BOOL DoProcess(WCHAR* lpParam) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class UICommandFactory
|
||||
* @brief Ŀ<>ǵ带 <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> Factory <20><>ü Server<65><72> Server<65><72> UI<55><49>ü<EFBFBD><C3BC> <20><><EFBFBD>ӹ´<DEB4>.
|
||||
* @remarks
|
||||
*
|
||||
* @par
|
||||
* @author Edith
|
||||
* @date 2009-05-09
|
||||
*/
|
||||
class UICommandFactory
|
||||
{
|
||||
public:
|
||||
BOOL AddCommand(const WCHAR* szCommand, UICommand* lpCommand, const WCHAR* szMessage)
|
||||
{
|
||||
if(0 == szCommand, 0 == lpCommand)
|
||||
return FALSE;
|
||||
|
||||
m_CMDVector.push_back(COMMAND(szCommand, lpCommand, szMessage));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID ReleaseCommand()
|
||||
{
|
||||
int iSize = m_CMDVector.size();
|
||||
for(int i = 0; i < iSize; ++i)
|
||||
{
|
||||
delete m_CMDVector[i].m_lpCMD;
|
||||
}
|
||||
|
||||
m_CMDVector.clear();
|
||||
}
|
||||
|
||||
virtual VOID InitializeCommand() {};
|
||||
|
||||
virtual VOID StartCommand() {}; // UIConsol<6F><6C><EFBFBD><EFBFBD> Command <20>Է<EFBFBD>
|
||||
virtual VOID EndCommand() {};
|
||||
|
||||
VOID ShowCommand()
|
||||
{
|
||||
LOG_IMPORTANT( (L"------------------- Commands -------------------") );
|
||||
int iSize = m_CMDVector.size();
|
||||
for(int i = 0; i < iSize; ++i)
|
||||
{
|
||||
LOG_IMPORTANT((L"%s : %s", m_CMDVector[i].m_szCMD, m_CMDVector[i].m_szMSG));
|
||||
}
|
||||
LOG_IMPORTANT( (L"----------------- Commands End -----------------") );
|
||||
}
|
||||
|
||||
VOID DoCommand(WCHAR* Command)
|
||||
{
|
||||
WCHAR Buff[DEF_BUFSIZE];
|
||||
ZeroMemory(Buff, DEF_BUFSIZE);
|
||||
wcscpy(Buff, Command);
|
||||
|
||||
WCHAR* cmd;
|
||||
cmd = wcstok(Command, L" ");
|
||||
if(cmd)
|
||||
{
|
||||
Nave::uint32 uiHash = Nave::Hash(cmd);
|
||||
WCHAR* NextCmd = &Buff[wcslen(cmd)+1];
|
||||
|
||||
int iSize = m_CMDVector.size();
|
||||
for(int i = 0; i < iSize; ++i)
|
||||
{
|
||||
if(m_CMDVector[i].m_uiHash != uiHash)
|
||||
continue;
|
||||
|
||||
m_CMDVector[i].m_lpCMD->DoProcess(NextCmd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
UICommandFactory()
|
||||
{
|
||||
}
|
||||
~UICommandFactory()
|
||||
{
|
||||
ReleaseCommand();
|
||||
}
|
||||
|
||||
private:
|
||||
struct COMMAND
|
||||
{
|
||||
Nave::uint32 m_uiHash;
|
||||
WCHAR m_szCMD[32];
|
||||
WCHAR m_szMSG[128];
|
||||
UICommand* m_lpCMD;
|
||||
|
||||
COMMAND(const WCHAR* szCommand, UICommand* lpCMD, const WCHAR* szMessage)
|
||||
{
|
||||
m_uiHash = Nave::Hash(szCommand);
|
||||
|
||||
wcscpy(m_szCMD, szCommand);
|
||||
|
||||
if(szMessage)
|
||||
wcscpy(m_szMSG, szMessage);
|
||||
else
|
||||
wcscpy(m_szMSG, L"No Help Message");
|
||||
|
||||
m_lpCMD = lpCMD;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::vector<COMMAND> CMDVector;
|
||||
CMDVector m_CMDVector;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class UIConsol
|
||||
* @brief <20>ܼ<EFBFBD> UI
|
||||
* @remarks
|
||||
*
|
||||
* @par
|
||||
* @author Edith
|
||||
* @date 2009-05-09
|
||||
*/
|
||||
class UIConsol : public UICommandFactory
|
||||
{
|
||||
BOOL m_bCommandExit;
|
||||
public:
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ʱ<EFBFBD>ȭ <20>մϴ<D5B4>. (<28><><EFBFBD><EFBFBD><EFBFBD>켳<EFBFBD><ECBCB3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ŀ<EFBFBD> ȣ<><C8A3>)
|
||||
virtual VOID InitObject() {};
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. (<28><><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(EndProcessȣ<73><C8A3><EFBFBD><EFBFBD>) ȣ<><C8A3>)
|
||||
virtual VOID ReleaseObject() {};
|
||||
|
||||
BOOL Init();
|
||||
|
||||
virtual VOID InitializeCommand() {};
|
||||
virtual VOID StartCommand(); // UIConsol<6F><6C><EFBFBD><EFBFBD> Command <20>Է<EFBFBD>
|
||||
virtual VOID EndCommand();
|
||||
|
||||
public:
|
||||
UIConsol(VOID);
|
||||
~UIConsol(VOID);
|
||||
};
|
||||
|
||||
/**
|
||||
* @class UIWindow
|
||||
* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UI
|
||||
* @remarks
|
||||
*
|
||||
* @par
|
||||
* @author Edith
|
||||
* @date 2009-05-09
|
||||
*/
|
||||
class UIWindow : public UICommandFactory
|
||||
{
|
||||
public:
|
||||
HWND GetWnd() { return m_hMainWnd; }
|
||||
BOOL IsExit() { return m_bCommandExit; }
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ʱ<EFBFBD>ȭ <20>մϴ<D5B4>. (<28><><EFBFBD><EFBFBD><EFBFBD>켳<EFBFBD><ECBCB3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ŀ<EFBFBD> ȣ<><C8A3>)
|
||||
virtual VOID InitObject() {};
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. (<28><><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(EndProcessȣ<73><C8A3><EFBFBD><EFBFBD>) ȣ<><C8A3>)
|
||||
virtual VOID ReleaseObject() {};
|
||||
|
||||
virtual VOID ShowWindow(int nCmdShow);
|
||||
|
||||
// Windows MsgProc
|
||||
virtual LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
BOOL Init(HINSTANCE hInstance, int nCmdShow, int iWidth, int iHeight, WCHAR* AppName, WCHAR* Icon);
|
||||
|
||||
virtual VOID InitializeCommand() {};
|
||||
virtual VOID StartCommand(); // UIConsol<6F><6C><EFBFBD><EFBFBD> Command <20>Է<EFBFBD>
|
||||
virtual VOID EndCommand();
|
||||
|
||||
public:
|
||||
UIWindow(VOID);
|
||||
~UIWindow(VOID);
|
||||
|
||||
private:
|
||||
HWND m_hMainWnd;
|
||||
BOOL m_bCommandExit;
|
||||
HFONT m_hFont;
|
||||
|
||||
VOID ResizeWindows( VOID );
|
||||
|
||||
// WM_EDIT_RETURN
|
||||
virtual VOID OnEditReturn(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
// WM_COMMAND
|
||||
virtual VOID OnCommand(HWND hWnd, INT nID, INT iEvent, LPARAM lParam) { return; }
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user