Skip to content

Commit b207771

Browse files
committed
2.04
1 parent dfd3bb3 commit b207771

20 files changed

+15471
-9395
lines changed

Client.cpp

+12-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ CClient::CClient(HWND hWnd)
3131

3232
m_bIsInitComplete = FALSE;
3333

34-
m_cLU_Str = m_cLU_Int = m_cLU_Vit = m_cLU_Dex = m_cLU_Mag = m_cLU_Char = 0;
34+
//m_cLU_Str = m_cLU_Int = m_cLU_Vit = m_cLU_Dex = m_cLU_Mag = m_cLU_Char = 0;
35+
m_iLU_Pool = 0;
36+
m_cAura = 0;
3537

3638
// v1.432 사용하지 않는다.
3739
//m_iHitRatio_ItemEffect_SM = 0;
@@ -272,10 +274,15 @@ CClient::~CClient()
272274

273275
if (m_pXSock != NULL) delete m_pXSock;
274276
for (i = 0; i < DEF_MAXITEMS; i++)
275-
if (m_pItemList[i] != NULL) {
276-
delete m_pItemList[i];
277-
m_pItemList[i] = NULL;
278-
}
277+
if (m_pItemList[i] != NULL) {
278+
delete m_pItemList[i];
279+
m_pItemList[i] = NULL;
280+
}
281+
for(i=0;i<DEF_MAXBANKITEMS;i++)
282+
if (m_pItemInBankList[i] != NULL) {
283+
delete m_pItemInBankList[i];
284+
m_pItemInBankList[i]=NULL;
285+
}
279286
}
280287

281288

Client.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ class CClient
9191

9292
int m_iLevel;
9393
int m_iStr, m_iInt, m_iVit, m_iDex, m_iMag, m_iCharisma;
94-
char m_cLU_Str, m_cLU_Int, m_cLU_Vit, m_cLU_Dex, m_cLU_Mag, m_cLU_Char; // 레벨업시에 할당되어 올라가는 특성치값.
94+
//char m_cLU_Str, m_cLU_Int, m_cLU_Vit, m_cLU_Dex, m_cLU_Mag, m_cLU_Char; // 레벨업시에 할당되어 올라가는 특성치값.
9595
int m_iLuck;
96+
int m_iLU_Pool;
97+
char m_cAura;
98+
//MOG var - 3.51
99+
int m_iGizonItemUpgradeLeft;
96100

97101
int m_iEnemyKillCount, m_iPKCount, m_iRewardGold;
98102
int m_iCurWeightLoad; // 현재 총 소지품 무게

DebugDialog.cpp

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#include "DebugDialog.h"
2+
#include "resource.h"
3+
4+
BOOL CALLBACK lpDialogFunc(HWND,UINT,WPARAM,LPARAM);
5+
void DebugWindowThread();
6+
HWND m_DbgWnd;
7+
HWND m_DbgList;
8+
HANDLE outHand;
9+
char crlf[]={0x0d,0x0a,0x0d,0x0a};
10+
11+
//Constructor
12+
CDebugWindow::CDebugWindow() : m_isVisible(FALSE)
13+
{
14+
}
15+
16+
// Startups The Debug Dialog
17+
void CDebugWindow::Startup(void)
18+
{
19+
DWORD lpThreadId;
20+
//Create a thread for dialog
21+
CloseHandle(CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)DebugWindowThread,NULL,0,&lpThreadId));
22+
//Give time for dialog to startup properly
23+
Sleep(10);
24+
}
25+
26+
void DebugWindowThread(){
27+
//start dialog
28+
DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)lpDialogFunc);
29+
}
30+
31+
BOOL CALLBACK lpDialogFunc(HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam){
32+
switch(uMsg) {
33+
case WM_INITDIALOG:
34+
//Copy HWND's
35+
m_DbgWnd = hDlg;
36+
m_DbgList = GetDlgItem(hDlg,IDC_DBGLIST);
37+
//Open File For Writing
38+
outHand = CreateFile("PacketData.txt",GENERIC_READ+GENERIC_WRITE,FILE_SHARE_READ+FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
39+
SetEndOfFile(outHand);
40+
break;
41+
default:
42+
return 0;
43+
}
44+
return 0;
45+
}
46+
47+
void CDebugWindow::Shutdown(void)
48+
{
49+
//Close Dialog
50+
EndDialog(m_DbgWnd,TRUE);
51+
//Close File Handle
52+
CloseHandle(outHand);
53+
}
54+
55+
void CDebugWindow::AddEventMsg(char* cMsg)
56+
{
57+
DWORD written;
58+
if (m_isVisible) {
59+
SendMessage(m_DbgList,LB_ADDSTRING,0,(LPARAM)cMsg);
60+
//Highlight Last Active Message
61+
SendMessage(m_DbgList,LB_SETCURSEL,SendMessage(m_DbgList,LB_GETCOUNT,0,0)-1,0);
62+
//Write data to file
63+
WriteFile(outHand,cMsg,strlen(cMsg),&written,NULL);
64+
WriteFile(outHand,crlf,4,&written,NULL);
65+
}
66+
}
67+
68+
void CDebugWindow::AddEventMsg(int cMsgType, char* cData, DWORD dwSize, char cKey)
69+
{
70+
DWORD written;
71+
char DbgBuffer[10000];
72+
73+
if (m_isVisible) {
74+
if (cMsgType == MSG_SEND) strcpy(DbgBuffer,"SEND -> ");
75+
else strcpy(DbgBuffer,"RECV -> ");
76+
77+
wsprintf(&DbgBuffer[8],"Size = %lu Key = 0x%.X",dwSize,cKey);
78+
SendMessage(m_DbgList,LB_ADDSTRING,0,(LPARAM)DbgBuffer);
79+
//Write data to file
80+
WriteFile(outHand,DbgBuffer,strlen(DbgBuffer),&written,NULL);
81+
WriteFile(outHand,crlf,2,&written,NULL);
82+
83+
int i=0;
84+
while(i<dwSize){
85+
memset(DbgBuffer,0,sizeof(DbgBuffer));
86+
strcpy(DbgBuffer, "DATA -> ");
87+
for(int j=i;j < i+16 && j < dwSize;j++)
88+
wsprintf(&DbgBuffer[strlen(DbgBuffer)],"%.2X ",(unsigned char)cData[j]);
89+
90+
//Align Spacing
91+
for(int a=strlen(DbgBuffer);a < 56; a+=3)
92+
strcat(DbgBuffer," ");
93+
94+
strcat(DbgBuffer,"\t\t\t");
95+
96+
for(j=i;j < i+16 && j < dwSize;j++)
97+
DbgBuffer[strlen(DbgBuffer)] = isprint((unsigned char)cData[j]) ? cData[j]:'.';
98+
99+
SendMessage(m_DbgList,LB_ADDSTRING,0,(LPARAM)DbgBuffer);
100+
WriteFile(outHand,DbgBuffer,strlen(DbgBuffer),&written,NULL);
101+
WriteFile(outHand,crlf,2,&written,NULL);
102+
i=j;
103+
}
104+
WriteFile(outHand,crlf,2,&written,NULL);
105+
106+
//Highlight Last Active Message
107+
SendMessage(m_DbgList,LB_SETCURSEL,SendMessage(m_DbgList,LB_GETCOUNT,0,0)-1,0);
108+
}
109+
}
110+
111+
void CDebugWindow::ShowWindow(bool isVisible)
112+
{
113+
Sleep(10);
114+
if (isVisible) {
115+
::ShowWindow(m_DbgWnd,SW_SHOW);
116+
m_isVisible = TRUE;
117+
}
118+
else {
119+
::ShowWindow(m_DbgWnd,SW_HIDE);
120+
m_isVisible = FALSE;
121+
}
122+
}

DebugDialog.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <windows.h>
2+
3+
#define MSG_RECV 1
4+
#define MSG_SEND 2
5+
6+
class CDebugWindow
7+
{
8+
9+
public:
10+
CDebugWindow();
11+
// Startups The Debug Dialog
12+
void Startup(void);
13+
void Shutdown(void);
14+
void AddEventMsg(char* cMsg);
15+
void AddEventMsg(int cMsgType, char* cData, DWORD dwSize, char cKey);
16+
void ShowWindow(bool isVisible);
17+
private:
18+
bool m_isVisible;
19+
};

0 commit comments

Comments
 (0)