-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathCashItemPeriodSystem.cpp
More file actions
586 lines (433 loc) · 15.6 KB
/
CashItemPeriodSystem.cpp
File metadata and controls
586 lines (433 loc) · 15.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
// CashItemPeriodSystem.cpp: implementation of the CCashItemPeriodSystem class.
// GS-N 1.00.18 JPN 0x00591EB0 - Completed
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "CashItemPeriodSystem.h"
#include "DBSockMng.h"
#include "LogProc.h"
#include "ItemAddOption.h"
#include "..\common\winutil.h"
CCashItemPeriodSystem g_CashItemPeriodSystem;
BOOL g_bRunningPeriodCheckThread = FALSE;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCashItemPeriodSystem::CCashItemPeriodSystem()
{
return;
}
CCashItemPeriodSystem::~CCashItemPeriodSystem()
{
return;
}
void CCashItemPeriodSystem::Initialize()
{
g_bRunningPeriodCheckThread = FALSE;
this->iItemPeriodInfoCount = 0;
for ( int i=0;i<MAX_ITEM_PERIOD_INFO;i++)
{
this->ItemPeriodInfo[i].btUsedInfo = 0;
this->ItemPeriodInfo[i].iUserIndex = -1;
this->ItemPeriodInfo[i].iUserGuid = -1;
this->ItemPeriodInfo[i].iItemCode = -1;
this->ItemPeriodInfo[i].iItemPeriodLeftTime = 0;
this->ItemPeriodInfo[i].btEffectType1 = 0;
this->ItemPeriodInfo[i].btEffectType2 = 0;
memset(this->ItemPeriodInfo[i].chCharacterName, 0, sizeof(this->ItemPeriodInfo[i].chCharacterName));
memset(this->ItemPeriodInfo[i].chItemPeriodBuyDate, 0, sizeof(this->ItemPeriodInfo[i].chItemPeriodBuyDate));
memset(this->ItemPeriodInfo[i].chItemPeriodEndDate, 0, sizeof(this->ItemPeriodInfo[i].chItemPeriodEndDate));
this->ItemPeriodInfo[i].dwItemCheckTickCount = 0;
}
if (g_bRunningPeriodCheckThread == FALSE )
{
this->hThreadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CCashItemPeriodSystem::PeriodCheckThread, this->ItemPeriodInfo, 0, NULL);
if ( this->hThreadHandle == NULL )
{
LogAdd("CreateThread() failed with error %d", GetLastError());
return;
}
}
g_bRunningPeriodCheckThread = TRUE;
CloseHandle(this->hThreadHandle);
}
DWORD CCashItemPeriodSystem::PeriodCheckThread(void * lpPeriodInfo)
{
ITEMPERIOD_INFO* lpPeriodInfoList = (ITEMPERIOD_INFO *)lpPeriodInfo;
int iIndex = 0;
DWORD dwCurrentTick = 0;
LPOBJ lpObj = NULL;
int iUseTime = 0;
while ( true )
{
if ( (GetTickCount() - dwCurrentTick) > 30000 )
{
dwCurrentTick = GetTickCount();
for ( iIndex=0;iIndex<MAX_ITEM_PERIOD_INFO;iIndex++)
{
if ( lpPeriodInfoList[iIndex].btUsedInfo == 1 )
{
iUseTime = GetTickCount() - lpPeriodInfoList[iIndex].dwItemCheckTickCount;
if ( iUseTime > 60000 )
{
lpPeriodInfoList[iIndex].dwItemCheckTickCount = GetTickCount();
lpPeriodInfoList[iIndex].iItemPeriodLeftTime--;
lpPeriodInfoList[iIndex].iItemPeriodUsedTime++;
lpObj = &gObj[lpPeriodInfoList[iIndex].iUserIndex];
if ( lpPeriodInfoList[iIndex].iItemPeriodLeftTime <= 0 )
{
g_CashItemPeriodSystem.GDReqPeriodItemUpdate(lpObj);
g_CashItemPeriodSystem.ClearPeriodItemEffect(lpObj);
}
}
}
}
}
else
{
Sleep(10);
}
}
return 0;
}
int CCashItemPeriodSystem::CalcItemUseLeftTime(LPSTR pchBuyDate)
{
int iUsedTime = 0;
CTime tCurrentTime = CTime::GetTickCount();
CTime tBuyTime;
CTimeSpan tTimeSpan;
this->ConvertStringToTime(pchBuyDate, &tBuyTime);
tCurrentTime - tBuyTime;
tTimeSpan = tBuyTime - tCurrentTime;
iUsedTime = tTimeSpan.GetTotalMinutes();
return iUsedTime;
}
CTime CCashItemPeriodSystem::CalcItemUseEndTime(int iLeftTime)
{
CTime tExpireTime;
CTime tCurrentTime = CTime::GetTickCount();
CTimeSpan tLeftTime(0, 0, iLeftTime, 0);
tExpireTime = tCurrentTime + tLeftTime;
return tExpireTime;
}
void CCashItemPeriodSystem::ConvertStringToTime(const char * pchDate, class CTime * lpTime)
{
int iYear=0;
int iMonth=0;
int iDay=0;
int iHour=0;
int iMinute=0;
int iDateLength=0;
char chDate[20];
char* Token;
char seps[4]="-: ";
if ( pchDate == NULL || lpTime == NULL )
return;
memcpy(chDate, pchDate, sizeof(chDate));
iDateLength = strlen(chDate);
if ( iDateLength <= 0 || iDateLength > 20 )
return;
Token = strtok( chDate, seps);
iYear = atoi(Token);
Token = strtok( NULL, seps);
iMonth = atoi(Token);
Token = strtok( NULL, seps);
iDay = atoi(Token);
Token = strtok( NULL, seps);
iHour = atoi(Token);
Token = strtok( NULL, seps);
iMinute = atoi(Token);
CTime tReturnTime(iYear, iMonth, iDay, iHour, iMinute, 0, -1);
*lpTime = tReturnTime;
}
void CCashItemPeriodSystem::ConvertTimeToString(const CTime * lpTime, LPSTR pchDate)
{
int iYear=0;
int iMonth=0;
int iDay=0;
int iHour=0;
int iMinute=0;
char chDate[20];
iYear = lpTime->GetYear();
iMonth = lpTime->GetMonth();
iDay = lpTime->GetDay();
iHour = lpTime->GetHour();
iMinute = lpTime->GetMinute();
wsprintf(chDate, "%d-%d-%d %d:%d", iYear, iMonth, iDay, iHour, iMinute);
memcpy(pchDate, chDate, sizeof(chDate));
}
BOOL CCashItemPeriodSystem::SetPeriodItemEffect(LPOBJ lpObj, int iItemCode, BYTE btEffectType1, BYTE btEffectType2, DWORD dwItemPeriod)
{
if ( lpObj->m_iPeriodItemEffectIndex != -1 )
{
if ( this->ItemPeriodInfo[lpObj->m_iPeriodItemEffectIndex].iUserIndex == lpObj->m_Index )
{
return FALSE;
}
}
for ( int i=0;i<MAX_ITEM_PERIOD_INFO;i++)
{
if ( this->ItemPeriodInfo[i].btUsedInfo == FALSE )
{
this->ItemPeriodInfo[i].btUsedInfo = TRUE;
this->ItemPeriodInfo[i].iUserIndex = lpObj->m_Index;
this->ItemPeriodInfo[i].iUserGuid = lpObj->DBNumber;
this->ItemPeriodInfo[i].iItemCode = iItemCode;
this->ItemPeriodInfo[i].btEffectType1 = btEffectType1;
this->ItemPeriodInfo[i].btEffectType2 = btEffectType2;
this->ItemPeriodInfo[i].iItemPeriodLeftTime = dwItemPeriod;
this->ItemPeriodInfo[i].iItemPeriodUsedTime = 0;
this->ItemPeriodInfo[i].dwItemCheckTickCount = GetTickCount();
lpObj->m_iPeriodItemEffectIndex = i;
if (g_ItemAddOption.SetItemEffect(lpObj, iItemCode, dwItemPeriod) == true )
{
#pragma message(" [TO FIX] !!! : Set Item Effect Missing Proper ViewSkill State")
::GCSkillInfoSend(lpObj, TRUE, 0x8000000); //???
}
return TRUE;
}
}
return FALSE;
}
BOOL CCashItemPeriodSystem::ClearPeriodItemEffect(LPOBJ lpObj)
{
int iItemInfoIndex =0 ;
iItemInfoIndex = lpObj->m_iPeriodItemEffectIndex;
if ( iItemInfoIndex < 0 || iItemInfoIndex > MAX_ITEM_PERIOD_INFO )
return FALSE;
if ( this->ItemPeriodInfo[iItemInfoIndex].btUsedInfo != TRUE )
{
if ( this->ItemPeriodInfo[iItemInfoIndex].iUserIndex != lpObj->m_Index )
{
return FALSE;
}
}
this->ItemPeriodInfo[iItemInfoIndex].btUsedInfo = FALSE;
this->ItemPeriodInfo[iItemInfoIndex].iUserIndex = 0;
this->ItemPeriodInfo[iItemInfoIndex].iItemCode = 0;
this->ItemPeriodInfo[iItemInfoIndex].iItemPeriodLeftTime = 0;
this->ItemPeriodInfo[iItemInfoIndex].btEffectType1 = 0;
this->ItemPeriodInfo[iItemInfoIndex].btEffectType2 = 0;
this->ItemPeriodInfo[iItemInfoIndex].iUserGuid = 0;
memset(this->ItemPeriodInfo[iItemInfoIndex].chCharacterName, 0, sizeof(this->ItemPeriodInfo[iItemInfoIndex].chCharacterName));
memset(this->ItemPeriodInfo[iItemInfoIndex].chItemPeriodBuyDate, 0, sizeof(this->ItemPeriodInfo[iItemInfoIndex].chItemPeriodBuyDate));
memset(this->ItemPeriodInfo[iItemInfoIndex].chItemPeriodEndDate, 0, sizeof(this->ItemPeriodInfo[iItemInfoIndex].chItemPeriodEndDate));
for(int i=0;i<2;i++)
{
g_ItemAddOption.ClearItemEffect(lpObj, 2 ,i);
}
#pragma message(" [TO FIX] !!! : Clear Item Effect Missing Proper ViewSkill State")
//GCSkillInfoSend(lpObj, 0, 0x8000000); //???
lpObj->m_iPeriodItemEffectIndex = -1;
return TRUE;
}
struct PMSG_REQ_PERIODITEM_INSERT
{
PBMSG_HEAD2 head; // C1:D0:03
int iUserIndex; // 4
int iUserGuid; // 8
int iItemCode; // C
int iItemPeriodDate; // 10
BYTE btItemEffectType1; // 14
BYTE btItemEffectType2; // 15
char chUserID[11]; // 16
char chExpireDate[20]; //21
};
void CCashItemPeriodSystem::GDReqPeriodItemInsert(LPOBJ lpObj, int iItemCode, int iItemEffectDate)
{
PMSG_REQ_PERIODITEM_INSERT pMsg;
int iEffectType1 =0;
int iEffectType2 =0;
CTime tExpireDate;
if ( g_ItemAddOption.SearchItemEffectType(iItemCode, &iEffectType1, &iEffectType2) == false )
return;
pMsg.iUserIndex = lpObj->m_Index;
pMsg.iUserGuid = lpObj->DBNumber;
pMsg.iItemCode = iItemCode;
pMsg.btItemEffectType1 = iEffectType1;
pMsg.btItemEffectType2 = iEffectType2;
pMsg.iItemPeriodDate = iItemEffectDate;
memcpy(pMsg.chUserID, lpObj->Name, sizeof(pMsg.chUserID));
tExpireDate = this->CalcItemUseEndTime(iItemEffectDate);
wsprintf(pMsg.chExpireDate, "%d-%d-%d %d:%d", tExpireDate.GetYear(), tExpireDate.GetMonth(), tExpireDate.GetDay(), tExpireDate.GetHour(), tExpireDate.GetMinute());
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x03, sizeof(PMSG_REQ_PERIODITEM_INSERT));
cDBSMng.Send((char *)&pMsg, sizeof(PMSG_REQ_PERIODITEM_INSERT));
LogAddTD("[CashShop][PeriodItemInsert Req] - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d, ExpireDate : %s",
lpObj->AccountID, lpObj->Name, pMsg.iItemCode, pMsg.btItemEffectType1, pMsg.btItemEffectType2, pMsg.iItemPeriodDate, pMsg.chExpireDate);
}
struct PMSG_REQ_PERIODITEM_LIST
{
PBMSG_HEAD2 head; // C1:D0:05
int iUserIndex; // 4
int iUserGuid; // 8
char chCharacterName[11]; // C
};
void CCashItemPeriodSystem::GDReqPeriodItemList(LPOBJ lpObj)
{
PMSG_REQ_PERIODITEM_LIST pMsg;
pMsg.iUserIndex = lpObj->m_Index;
pMsg.iUserGuid = lpObj->DBNumber;
memcpy(pMsg.chCharacterName, lpObj->Name, sizeof(pMsg.chCharacterName));
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x05, sizeof(PMSG_REQ_PERIODITEM_LIST));
cDBSMng.Send((char *)&pMsg, sizeof(PMSG_REQ_PERIODITEM_LIST));
}
struct PMSG_REQ_PERIODITEM_INQUIRY
{
PBMSG_HEAD2 head; // C1:D0:01
int iUserIndex; // 4
int iUserGuid; // 8
};
void CCashItemPeriodSystem::GDReqPeriodItemInquiry(LPOBJ lpObj)
{
PMSG_REQ_PERIODITEM_INQUIRY pMsg;
pMsg.iUserIndex = lpObj->m_Index;
pMsg.iUserGuid = lpObj->DBNumber;
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x01, sizeof(PMSG_REQ_PERIODITEM_INQUIRY));
cDBSMng.Send((char *)&pMsg, sizeof(PMSG_REQ_PERIODITEM_INQUIRY));
}
struct PMSG_REQ_PERIODITEM_UPDATE
{
PBMSG_HEAD2 head; // C1:D0:07
int iUserIndex; // 4
int iUserGuid; // 8
int iItemCode; // C
int iUsedTime; // 10
int iLeftTime; // 14
char chCharacterName[11]; // 18
};
void CCashItemPeriodSystem::GDReqPeriodItemUpdate(LPOBJ lpObj)
{
PMSG_REQ_PERIODITEM_UPDATE pMsg;
ITEMPERIOD_INFO* lpItemInfo = NULL;
if ( lpObj->m_iPeriodItemEffectIndex < 0 || lpObj->m_iPeriodItemEffectIndex >=MAX_ITEM_PERIOD_INFO )
return;
lpItemInfo = &this->ItemPeriodInfo[lpObj->m_iPeriodItemEffectIndex];
pMsg.iUserGuid = lpObj->DBNumber;
pMsg.iItemCode = lpItemInfo->iItemCode;
pMsg.iUserIndex = lpObj->m_Index;
pMsg.iUsedTime = lpItemInfo->iItemPeriodUsedTime;
pMsg.iLeftTime = lpItemInfo->iItemPeriodLeftTime;
memcpy(pMsg.chCharacterName, lpObj->Name, sizeof(pMsg.chCharacterName));
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x07, sizeof(PMSG_REQ_PERIODITEM_UPDATE));
cDBSMng.Send((char *)&pMsg, sizeof(PMSG_REQ_PERIODITEM_UPDATE));
}
void CCashItemPeriodSystem::DGAnsPeriodItemInsert(PMSG_ANS_PERIODITEM_INSERT * aRecv)
{
int iIndex = aRecv->iUserIndex;
LPOBJ lpObj = &gObj[iIndex];
BYTE btResult = FALSE;
switch ( aRecv->btResult )
{
case 0: btResult = 1; break;
case 1: btResult = 2; break;
case 2: btResult = 3; break;
default: btResult = 1;
}
if ( btResult == 1 )
{
this->SetPeriodItemEffect(lpObj, aRecv->iItemCode, aRecv->btItemEffectType1, aRecv->btItemEffectType2, aRecv->iItemPeriodDate);
LogAddTD("[CashShop][PeriodItemInsert Ans] Success - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btItemEffectType1, aRecv->btItemEffectType2, aRecv->iItemPeriodDate);
}
else
{
LogAddTD("[CashShop][PeriodItemInserver Ans] Fail - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d, Result : %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btItemEffectType1, aRecv->btItemEffectType2, aRecv->iItemPeriodDate, btResult);
}
this->GCSendPeriodItemInserResult(lpObj, btResult);
}
void CCashItemPeriodSystem::DGAnsPeriodItemList(PMSG_ANS_PERIODITEM_LIST* aRecv)
{
if ( aRecv->iUserIndex <= 0 || aRecv->iUserIndex > OBJMAX )
return;
LPOBJ lpObj = &gObj[aRecv->iUserIndex];
int iItemLeftUseTime = 0;
int iResult = 0;
iResult = aRecv->btResult;
if ( lpObj->DBNumber != aRecv->iUserGuid )
return;
if ( iResult == -1 )
{
LogAddTD("[CashShop][PeriodItemSelect Ans] Failed - Item over 1 item ID : %s, Name : %s",
lpObj->AccountID, lpObj->Name);
}
else if ( iResult == -2 )
{
LogAddTD("[CashShop][PeriodItemSelect Ans] Failed - Item usedtime is over ID : %s, Name : %s",
lpObj->AccountID, lpObj->Name);
}
iItemLeftUseTime = aRecv->iLeftTime;
if ( iItemLeftUseTime > 0 )
{
this->SetPeriodItemEffect(lpObj, aRecv->iItemCode, aRecv->btEffectType1, aRecv->btEffectType2, iItemLeftUseTime);
LogAddTD("[CashShop][PeriodItemList Ans] Success - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btEffectType1, aRecv->btEffectType2, iItemLeftUseTime);
}
else
{
LogAddTD("[CashShop][PeriodItemList Ans] Fail - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btEffectType1, aRecv->btEffectType2, iItemLeftUseTime);
}
}
void CCashItemPeriodSystem::DGAnsPeriodItemInquiry(PMSG_ANS_PERIODITEM_INQUIRY *aRecv)
{
return;
}
void CCashItemPeriodSystem::DGAnsPeriodItemUpdate(PMSG_ANS_PERIODITEM_UPDATE *aRecv)
{
int iUserIndex = aRecv->iUserIndex;
if ( iUserIndex < 0 || iUserIndex > OBJMAX )
return;
LPOBJ lpObj = &gObj[iUserIndex];
ITEMPERIOD_INFO* lpItemInfo = NULL;
if ( lpObj->m_iPeriodItemEffectIndex < 0 || lpObj->m_iPeriodItemEffectIndex >=MAX_ITEM_PERIOD_INFO )
return;
lpItemInfo = &this->ItemPeriodInfo[lpObj->m_iPeriodItemEffectIndex];
if ( lpObj->m_iPeriodItemEffectIndex != lpItemInfo->iUserIndex ) // #error - Apply Deathway fix here
return;
switch ( aRecv->btResult )
{
case 3:
if ( this->ClearPeriodItemEffect(lpObj) == TRUE )
{
LogAddTD("[CashShop][PeriodItemUpdate Ans] Remove Item Effect - ID : %s, Name : %s, ItemCode : %d, Result : %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btResult);
}
}
LogAddTD("[CashShop][PeriodItemUpdate Ans] - ID : %s, Name : %s, ItemCode : %d, Result %d",
lpObj->AccountID, lpObj->Name, aRecv->iItemCode, aRecv->btResult);
}
struct PMSG_REQ_PERIODITEM_DELETE
{
PBMSG_HEAD2 head; // C1:D0:09
int iUserIndex; // 4
int iUserGuid; // 8
char chCharacterName[11]; // C
};
void CCashItemPeriodSystem::GDReqPeriodItemDelete(LPOBJ lpObj, LPSTR pchCharacterName)
{
PMSG_REQ_PERIODITEM_DELETE pMsg;
pMsg.iUserIndex = lpObj->m_Index;
pMsg.iUserGuid = lpObj->DBNumber;
memcpy(pMsg.chCharacterName, pchCharacterName, sizeof(pMsg.chCharacterName));
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x09, sizeof(PMSG_REQ_PERIODITEM_DELETE));
cDBSMng.Send((char*)&pMsg, sizeof(PMSG_REQ_PERIODITEM_DELETE));
}
#pragma warning ( disable : 4060 )
void CCashItemPeriodSystem::DGAnsPeriodItemDelete(PMSG_ANS_PERIODITEM_DELETE *aRecv)
{
LPOBJ lpObj = NULL;
if ( aRecv->iUserIndex < 0 || aRecv->iUserIndex > OBJMAX )
return;
lpObj = &gObj[aRecv->iUserGuid]; // #error : Apply Deathway Fix Here
if ( lpObj->DBNumber != aRecv->iUserGuid )
return;
switch ( aRecv->btResult ){}
}
#pragma warning ( disable : 4060 )
void CCashItemPeriodSystem::GCSendPeriodItemInserResult(LPOBJ lpObj, BYTE btResult)
{
PMSG_ANS_PERIODITEM_INSERT_RESULT pMsg;
pMsg.btResult = btResult;
PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x03, sizeof(PMSG_ANS_PERIODITEM_INSERT_RESULT));
DataSend(lpObj->m_Index, (LPBYTE)&pMsg, sizeof(PMSG_ANS_PERIODITEM_INSERT_RESULT));
}