阅读:2091回复:0
【源码编译】修复秒杀/隐身/召唤/瞬移/非法物品错误
1. 首先打开DPSrvr.cpp
2. 搜索下面的3处功能:CDPSrvr::OnModifyMode CDPSrvr::OnSummonPlayer CDPSrvr::OnTeleportPlayer 他们后面的代码#ifdef __HACK_0516 DPID dpid; ar >> dpid; if( pUser->m_Snapshot.dpidUser != dpid ) { Error( "[%s] try to hack : PACKETTYPE_MODIFYMODE", pUser->GetName() ); return; } #endif // __HACK_0516 修改为:#ifdef __HACK_0516 DPID dpid; ar >> dpid; if( pUser->m_Snapshot.dpidUser != dpid ) { Error( "[%s] try to hack : PACKETTYPE_MODIFYMODE", pUser->GetName() ); return; } if( !pUser->IsAuthHigher(AUTH_GAMEMASTER) ) { Error( "[%s] try to hack with dpid : PACKETTYPE_MODIFYMODE", pUser->GetName() ); return; } #endif // __HACK_0516 如果你没有 定义__HACK_0516 那么 定义它:-* 3.非法创建物品修复如下:CDPSrvr::OnBuyingInfo 编辑这个代码如下:void CDPSrvr::OnBuyingInfo( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) {/* BUYING_INFO2 bi2; ar.Read( (void*)&bi2, sizeof(BUYING_INFO2) ); CWorld* pWorld; CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser ); SERIALNUMBER iSerialNumber = 0; if( IsValidObj( pUser ) && ( pWorld = pUser->GetWorld() ) ) { bi2.dwRetVal = 0; CItemElem itemElem; 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_1015 g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos(), pUser->GetLayer() ); #else // __LAYER_1015 g_dpDBClient.SavePlayer( pUser, pWorld->GetID(), pUser->GetPos() ); #endif // __LAYER_1015 if( bi2.dwRetVal ) { CItemElem* pItemElem = pUser->m_Inventory.GetAtId( nId ); if( pItemElem ) { iSerialNumber = pItemElem->GetSerialNumber(); pItemElem->m_bCharged = TRUE; if( bi2.dwSenderId > 0 ) { // %s을 %s님으로부터 선물 받았습니다. } } } } g_dpDBClient.SendBuyingInfo( &bi2, iSerialNumber ); // FILEOUT( "buyinginfo.txt", "dwServerIndex = %d\tdwPlayerId = %d\tdwItemId = %d\tdwItemNum = %d\n", // bi2.dwServerIndex, bi2.dwPlayerId, bi2.dwItemId, bi2.dwItemNum ); static char lpOutputString[260] = { 0, }; sprintf( lpOutputString, "dwServerIndex = %d\tdwPlayerId = %d\tdwItemId = %d\tdwItemNum = %d", bi2.dwServerIndex, bi2.dwPlayerId, bi2.dwItemId, bi2.dwItemNum ); OutputDebugString( lpOutputString ); */} |
|
100% |