本文整理汇总了C++中CDPSrvr::OnLogItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CDPSrvr::OnLogItem方法的具体用法?C++ CDPSrvr::OnLogItem怎么用?C++ CDPSrvr::OnLogItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDPSrvr
的用法示例。
在下文中一共展示了CDPSrvr::OnLogItem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetChipNum
// 승자에게 칩지급하고 메세지 출력(패자는 메세지만 출력)
void CGuildCombat1to1::SetWinChip( CUser* pUserWin, CUser* pUserLost, BOOL bDraw, BOOL bDiag )
{
if( bDraw ) // 비겼을 때(칩 지급 안하고 메세지만 출력)
{
if( bDiag ) // 개인 승패만 메세지 박스 출력
{
if( IsPossibleUser( pUserWin ) )
pUserWin->AddDiagText( prj.GetText( TID_GAME_GUILDCOMBAT_1TO1_WARDRAW ) );
if( IsPossibleUser( pUserLost ) )
pUserLost->AddDiagText( prj.GetText( TID_GAME_GUILDCOMBAT_1TO1_WARDRAW ) );
}
return;
}
if( IsPossibleUser( pUserWin ) )
{
CItemElem itemElem;
itemElem.m_dwItemId = II_CHP_RED;
itemElem.m_nItemNum = GetChipNum();
if( itemElem.m_nItemNum < 1 )
itemElem.m_nItemNum = 1;
itemElem.m_bCharged = itemElem.GetProp()->bCharged;
itemElem.SetSerialNumber();
LogItemInfo aLogItem;
aLogItem.Action = "W";
aLogItem.Gold = pUserWin->GetItemNum( II_CHP_RED );
aLogItem.Gold2 = pUserWin->GetItemNum( II_CHP_RED ) + itemElem.m_nItemNum;
aLogItem.Gold_1 = itemElem.m_nItemNum;
aLogItem.SendName = pUserWin->GetName();
aLogItem.WorldId = pUserWin->GetWorld()->m_dwWorldID;
if( pUserWin->CreateItem( &itemElem ) )
{
aLogItem.RecvName = "GUILDCOMBAT1TO1_CHIP";
if( !bDiag )
aLogItem.RecvName = "GUILDCOMBAT1TO1_G_CHIP";
}
else // 지급 실패시(인벤토리가 꽉찼거나 등의 이유로...) 메일로 지급
{
g_dpDBClient.SendQueryPostMail( pUserWin->m_idPlayer, 0, itemElem, 0, itemElem.GetProp()->szName, (char*)GETTEXT( TID_GAME_GUILDCOMBAT1TO1_WINCHIPPOST ) );
//pUserWin->AddDefinedText( TID_GAME_MINIGAME_ITEM_POST );
aLogItem.RecvName = "GUILDCOMBAT1TO1_CHIP_POST";
if( !bDiag )
aLogItem.RecvName = "GUILDCOMBAT1TO1_CHIP_G_POST";
}
if( bDiag ) // 개인 승패만 메세지 박스 출력
{
CString strTemp;
strTemp.Format( prj.GetText( TID_GAME_GUILDCOMBAT_1TO1_WARWIN ), GetChipNum() );
pUserWin->AddDiagText( strTemp );
}
g_DPSrvr.OnLogItem( aLogItem, &itemElem, itemElem.m_nItemNum );
}
if( IsPossibleUser( pUserLost ) && bDiag )
pUserLost->AddDiagText( prj.GetText( TID_GAME_GUILDCOMBAT_1TO1_WARLOST ) );
}
示例2: __CreateItem
void __CreateItem( DWORD dwIdMover, int v1, int v2 )
#endif // __JEFF_11
{
CUser* pUser = prj.GetUser( dwIdMover );
ItemProp* pItemProp = prj.GetItemProp( v1 );
if( pItemProp )
pUser->AddDefinedText( TID_EVE_REAPITEM, "\"%s\"", pItemProp->szName );
CItemElem itemElem;
itemElem.m_dwItemId = v1;
itemElem.m_nItemNum = v2;
#ifdef __JEFF_11
itemElem.SetAbilityOption( v3 );
#endif // __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
itemElem.SetFlag( v4 );
#endif // __CHIPI_QUESTITEM_FLAG
if( pUser->CreateItem( &itemElem ) )
{
LogItemInfo aLogItem;
aLogItem.Action = "Q";
aLogItem.SendName = pUser->GetName();
aLogItem.RecvName = "QUEST";
aLogItem.WorldId = pUser->GetWorld()->GetID();
aLogItem.Gold = aLogItem.Gold2 = pUser->GetGold();
g_DPSrvr.OnLogItem( aLogItem, &itemElem, itemElem.m_nItemNum );
}
}
示例3:
// 입찰 취소
void CGuildCombat1to1Mng::SetCancelTenderGuild( CUser* pUser )
{
if( m_nState != GC1TO1_CLOSE )
{
pUser->AddDiagText( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_NOTENDER ) );
return;
}
// 길드마스터만 입찰 취소 가능
if( !IsGuildMaster( pUser ) )
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_NOTMASTER );
return;
}
CGuild* pGuild = pUser->GetGuild();
if( pGuild )
{
for( vector<__GC1TO1TENDER>::iterator it=m_vecTenderGuild.begin(); it!=m_vecTenderGuild.end(); it++ )
{
if( (*it).ulGuildId == pGuild->GetGuildId() )
{
int nReturnGold = (int)( (*it).nPenya * ( (float)m_nCancelReturnRate / 100 ) );
//인벤 꽉 찼을때 예외처리 해야함..
int nTotal = pUser->GetGold() + nReturnGold;
if( nReturnGold > 0 && nTotal < 0 ) // overflow
{
pUser->AddDefinedText( TID_GAME_LACKSPACE );
return;
}
pUser->AddGold( nReturnGold );
g_dpDBClient.SendGC1to1Tender( 'U', (*it).ulGuildId, (*it).nPenya, 'C' );
m_vecTenderGuild.erase( it );
CString strTemp;
strTemp.Format( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_CANCELTENDER ), nReturnGold );
pUser->AddDiagText( strTemp );
// 로그 남김(아이템로그)
LogItemInfo aLogItem;
aLogItem.Action = "9";
aLogItem.SendName = pUser->GetName();
aLogItem.RecvName = "GUILDCOMBAT1TO1_CANCELRETURN";
aLogItem.WorldId = pUser->GetWorld()->GetID();
//aLogItem.ItemName = "SEED";
_stprintf( aLogItem.szItemName, "%d", II_GOLD_SEED1 );
aLogItem.Gold = pUser->GetGold() - nReturnGold;
aLogItem.Gold2 = pUser->GetGold();
aLogItem.Gold_1 = nReturnGold;
g_DPSrvr.OnLogItem( aLogItem );
break;
}
}
}
}
示例4: RemoveInfo
void CCreateMonster::RemoveInfo( CMover* pMover )
{
MAPINFO::iterator it=m_mapCreateMonsterInfo.find( pMover->GetId() );
if( it == m_mapCreateMonsterInfo.end() )
return;
CREATE_MONSTER_INFO createMonsterInfo = it->second;
if( pMover )
{
LogItemInfo aLogItem;
aLogItem.Action = "i";
aLogItem.SendName = CPlayerDataCenter::GetInstance()->GetPlayerString( createMonsterInfo.dwOwnerId );
char szTemp[128] = {0,};
sprintf( szTemp, "M_%c_%s", createMonsterInfo.chState, pMover->GetName() );
memset( szTemp+31, 0, sizeof(szTemp)-31 );
aLogItem.RecvName = szTemp;
aLogItem.Gold = aLogItem.Gold2 = 0;
aLogItem.Gold_1 = pMover->GetId();
aLogItem.WorldId = pMover->GetWorld()->GetID();
g_DPSrvr.OnLogItem( aLogItem );
}
m_mapCreateMonsterInfo.erase( it );
}
示例5: GetTenderGuildIndexByUser
// 입찰 및 입찰금 순서로 정렬
void CGuildCombat1to1Mng::SetTenderGuild( CUser* pUser, int nPenya )
{
if( !g_eLocal.GetState( EVE_GUILDCOMBAT1TO1 ) )
return;
if( m_nState != GC1TO1_CLOSE )
{
pUser->AddDiagText( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_NOTENDER ) );
return;
}
// 길드대전에 입찰한 길드는 입찰할 수 없다.
if( IsGCTenderGuild( pUser ) )
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_ISGCTENDER );
return;
}
// 길드마스터만 입찰 가능
if( !IsGuildMaster( pUser ) )
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_NOTMASTER );
return;
}
// 참가할 수 있는 최소 길드레벨 검사...
if( pUser->GetGuild()->m_nLevel < m_nGuildLevel )
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_LOWGUILDLEVEL, "%d", m_nGuildLevel );
return;
}
// 최소 입찰 페냐 보다 많아야 한다.
if( nPenya < m_nJoinPenya )
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_LIMIT_MIN );
return;
}
// 로그 남길 준비(아이템로그)
LogItemInfo aLogItem;
aLogItem.Action = "9";
aLogItem.SendName = pUser->GetName();
aLogItem.RecvName = "GUILDCOMBAT1TO1";
aLogItem.WorldId = pUser->GetWorld()->GetID();
//aLogItem.ItemName = "SEED";
_stprintf( aLogItem.szItemName, "%d", II_GOLD_SEED1 );
int nIndex = GetTenderGuildIndexByUser( pUser );
if( nIndex != NULL_ID ) // 이미 입찰한 길드는 더많은 금액으로 입찰해야 한다.
{
if( m_vecTenderGuild[nIndex].nPenya < nPenya )
{
if( (DWORD)( nPenya ) > (DWORD)(pUser->GetGold() + m_vecTenderGuild[nIndex].nPenya) )
{
pUser->AddDefinedText( TID_GAME_LACKMONEY ); // 페냐가 부족하다.
return;
}
pUser->AddGold( m_vecTenderGuild[nIndex].nPenya - nPenya );
CString strTemp;
strTemp.Format( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_MORETENDER ), nPenya - m_vecTenderGuild[nIndex].nPenya, nPenya );
pUser->AddDiagText( strTemp );
m_vecTenderGuild[nIndex].nPenya = nPenya;
// 로그 남김
aLogItem.Gold = pUser->GetGold() + (nPenya - m_vecTenderGuild[nIndex].nPenya) ;
aLogItem.Gold2 = pUser->GetGold();
aLogItem.Gold_1 = m_vecTenderGuild[nIndex].nPenya - nPenya;
g_DPSrvr.OnLogItem( aLogItem );
g_dpDBClient.SendGC1to1Tender( 'U', pUser->m_idGuild, nPenya, 'T' );
}
else // 기존보다 더 많은 페냐 입찰 요구
{
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_MORE_CURRENT_REQUEST );
return;
}
}
else // 처음 입찰하는 길드이면..
{
if( nPenya > pUser->GetGold() ) // 페냐 부족
{
pUser->AddDefinedText( TID_GAME_LACKMONEY );
return;
}
__GC1TO1TENDER TenderGuild;
TenderGuild.ulGuildId = pUser->m_idGuild;
TenderGuild.nPenya = nPenya;
m_vecTenderGuild.push_back( TenderGuild );
pUser->AddGold( -nPenya );
CString strTemp;
strTemp.Format( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_TENDERPENYA ), nPenya );
pUser->AddDiagText( strTemp );
// 로그 남김
aLogItem.Gold = pUser->GetGold() + nPenya;
aLogItem.Gold2 = pUser->GetGold();
aLogItem.Gold_1 = -nPenya;
g_DPSrvr.OnLogItem( aLogItem );
g_dpDBClient.SendGC1to1Tender( 'I', pUser->m_idGuild, nPenya, 'T' );
//.........这里部分代码省略.........
示例6: CreateMonster
void CCreateMonster::CreateMonster( CUser* pUser, DWORD dwObjId, D3DXVECTOR3 vPos )
{
if( (int)( m_mapCreateMonsterInfo.size() ) >= m_nMaxCreateNum )
{
pUser->AddDefinedText( TID_GAME_CREATEMON_LIMIT );
return;
}
CItemElem* pItemElem = pUser->m_Inventory.GetAtId( dwObjId );
if( !IsUsableItem( pItemElem ) )
return;
CREATE_MONSTER_PROP* pCreateMonsterProp = GetCreateMonsterProp( pItemElem );
if( !pCreateMonsterProp )
return;
DWORD dwMonsterId = pCreateMonsterProp->GetRandomMonsterId();
if( dwMonsterId == NULL_ID )
return;
CWorld* pWorld = pUser->GetWorld();
MoverProp* pMoverProp = prj.GetMoverProp( dwMonsterId );
if( pWorld && pMoverProp && pMoverProp->dwID != 0 )
{
D3DXVECTOR3 vDist2 = pUser->GetPos() - vPos;
float fDist = D3DXVec3Length( &vDist2 ); // 두좌표간의 거리
if( 15.f < fDist )
{
pUser->AddDefinedText( TID_GAME_CREATEMON_F_15 );
return;
}
int nAttr = pWorld->GetHeightAttribute( vPos.x, vPos.z ); // 이동할 위치의 속성 읽음.
if( nAttr == HATTR_NOWALK || nAttr == HATTR_NOMOVE ) // 못 움직이는 곳이면 Pass
{
pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA );
return;
}
if( pUser->IsRegionAttr( RA_SAFETY )) // 안전지역이면 Pass
{
pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA );
return;
}
if( pWorld->GetID() != WI_WORLD_MADRIGAL )
{
pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA );
return;
}
CObj* pObj = CreateObj( D3DDEVICE, OT_MOVER, pMoverProp->dwID );
if( NULL == pObj ) return; // ASSERT( pObj );
pObj->SetPos( vPos );
pObj->InitMotion( MTI_STAND );
pObj->UpdateLocalMatrix();
((CMover*)pObj)->m_bActiveAttack = FALSE;
((CMover*)pObj)->AddItToGlobalId();
pWorld->ADDOBJ( pObj, FALSE, pUser->GetLayer() );
LogItemInfo aLogItem;
aLogItem.Action = "i";
aLogItem.SendName = pUser->GetName();
char szTemp[128] = {0,};
sprintf( szTemp, "M_C_%s", pMoverProp->szName );
memset( szTemp+31, 0, sizeof(szTemp)-31 );
aLogItem.RecvName = szTemp;
aLogItem.Gold = aLogItem.Gold2 = pUser->GetGold();
aLogItem.Gold_1 = ((CMover*)pObj)->GetId();
aLogItem.WorldId = pUser->GetWorld()->GetID();
g_DPSrvr.OnLogItem( aLogItem, pItemElem, 1 );
pUser->AddDefinedText( TID_GAME_CREATEMON_S, "\"%s\"", pMoverProp->szName );
pUser->RemoveItem( (BYTE)( dwObjId ), (short)( 1 ) );
CREATE_MONSTER_INFO createMonsterInfo;
createMonsterInfo.chState = 'N';
createMonsterInfo.dwOwnerId = pUser->m_idPlayer;
createMonsterInfo.dwEndTick = pCreateMonsterProp->dwKeepTime + GetTickCount();
m_mapCreateMonsterInfo.insert( make_pair( ((CMover*)pObj)->GetId(), createMonsterInfo ) );
}
}