1. 首先打开DPSrvr.cpp ~5 H, p+ X" L5 k1 w6 + k+ Z9 X0 s 2. 搜索下面的3处功能:CDPSrvr::OnModifyMode CDPSrvr::OnSummonPlayer CDPSrvr::OnTeleportPlayer 5 B/ b7 Y" H, j+ ~2 d/ B( s5 h: E 他们后面的代码#ifdef __HACK_05163 J& c1 a6 L6 d" t) C DPID dpid;/ m8 Q+ k0 y: h ar >> dpid;6 t+ M9 [, x2 B. d3 ]& i+ j* X if( pUser->m_Snapshot.dpidUser != dpid ) { Error( "[%s] try to hack : PACKETTYPE_MODIFYMODE", pUser->GetName() );* D7 W; h$ N! w: E+ ! i return;0 K5 a7 n* Y' k u7 X' e }8 i5 d) G" r, Z$ x8 K #endif // __HACK_0516 修改为:#ifdef __HACK_05166 z# `" O' _/ `* P& T7 @ DPID dpid;+ A+ {' j) n" T5 g1 d2 h' i ar >> dpid;- [ J( a9 T$ r' t' X2 Q8 n if( pUser->m_Snapshot.dpidUser != dpid )0 l b; V) R; m3 G# {" u [ { b/ D# R" H$ K Error( "[%s] try to hack : PACKETTYPE_MODIFYMODE", pUser->GetName() ); return;) a0 L" u9 q- p# d } if( !pUser->IsAuthHigher(AUTH_GAMEMASTER) )4 U! h8 S8 W/ Q5 Q7 I {, K% ( h- i k0 R( M- K Error( "[%s] try to hack with dpid : PACKETTYPE_MODIFYMODE", pUser->GetName() ); return;7 Q% \0 V, M( z5 ]; { } #endif // __HACK_0516 如果你没有 定义__HACK_0516 那么 定义它:-*& ]4 ]7 P; p+ T# }5 W7 S% [ / x+ ?3 _) E4 Q- ?' u 3.非法创建物品修复如下:CDPSrvr::OnBuyingInfo# _1 f. ^& A, v' W: Y
编辑这个代码如下:void CDPSrvr::OnBuyingInfo( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ). N8 v$ n4 t4 ?7 z6 U" `5 I {/* BUYING_INFO2 bi2;) I, l8 j& @3 v! M0 `. S ar.Read( (void*)&bi2, sizeof(BUYING_INFO2) );
CWorld* pWorld;* I: |; }. p5 n9 G8 J) c CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );" {1 W/ D4 C2 V; _2 V' w3 d 2 @. ]: Q, K" b1 C+ E SERIALNUMBER iSerialNumber = 0;5 ?- Q0 g i% @9 if( IsValidObj( pUser ) && ( pWorld = pUser->GetWorld() ) )' D( n A* E5 M, {8 ? { bi2.dwRetVal = 0; CItemElem itemElem;$ }; }( n" p# H3 O itemElem.m_dwItemId = bi2.dwItemId; itemElem.m_nItemNum = (short)bi2.dwItemNum; itemElem.m_bCharged = TRUE; BYTE nId; bi2.dwRetVal = pUser->CreateItem( &itemElem, &nId ); #ifdef __LAYER_10159 {8 X" $ R* I' w0 l& f7 m g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos(), pUser->GetLayer() );. Y( u6 u% x7 J5 G/ m #else // __LAYER_10159 z# c( % L, S! p g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos() ); #endif // __LAYER_1015 if( bi2.dwRetVal )7 o( f- w; x4 P& }2 k# b( u2 D {& O! f5 g7 4 p, P" G CItemElem* pItemElem = pUser->m_Inventory.GetAtId( nId );' P2 M: |" T! T. ?/ N; h if( pItemElem ) { iSerialNumber = pItemElem->GetSerialNumber();0 U. q. F" j1 ^+ Y- ], Z8 m7 z pItemElem->m_bCharged = TRUE;" s/ n! C- L7 d" I if( bi2.dwSenderId > 0 )3 R& l* Y: D/ U3 w8 R { // %s을 %s님으로부터 선물 받았습니다.* O/ c# l) q3 i/ ]# t }% x! i, {. c2 p } }7 l9 z8 k" ]+ b } g_dpDBClient.SendBuyingInfo( &bi2, iSerialNumber ); // FILEOUT( "buyinginfo.txt", "dwServerIndex = %dtdwPlayerId = %dtdwItemId = %dtdwItemNum = %dn", " c9 t3 k) E) z. G // bi2.dwServerIndex, bi2.dwPlayerId, bi2.dwItemId, bi2.dwItemNum ); static char lpOutputString[260] = { 0, }; sprintf( lpOutputString, "dwServerIndex = %dtdwPlayerId = %dtdwItemId = %dtdwItemNum = %d", bi2.dwServerIndex, bi2.dwPlayerId, bi2.dwItemId, bi2.dwItemNum ); OutputDebugString( lpOutputString );3 R# k d6 b% e3 U */} |