本文整理汇总了C++中CDPDatabaseClient类的典型用法代码示例。如果您正苦于以下问题:C++ CDPDatabaseClient类的具体用法?C++ CDPDatabaseClient怎么用?C++ CDPDatabaseClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDPDatabaseClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTickCount
// 현재 대전자가 모두 존재하면 대전 시작
void CGuildCombat1to1::GuildCombat1to1War()
{
CUser* pUser0 = NULL;
CUser* pUser1 = NULL;
if( (int)( m_vecTenderGuild[m_nIndex[0]].vecMemberId.size() ) > m_nProgWarCount )
pUser0 = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount] );
if( (int)( m_vecTenderGuild[m_nIndex[1]].vecMemberId.size() ) > m_nProgWarCount )
pUser1 = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount] );
// 양쪽 대전자가 모두 존재하면 대전 시작
if( IsPossibleUser( pUser0 ) && IsPossibleUser( pUser1 ) )
{
g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount], 'N' );
g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount], 'N' );
SetTeleportToWarStage( pUser0 ); // 대전장으로 텔레포트
SetTeleportToWarStage( pUser1 ); // 대전장으로 텔레포트
m_nState = GC1TO1WAR_WAR;
m_nWaitTime = (int)g_GuildCombat1to1Mng.m_Lua.GetGlobalNumber( "WarTime" );
m_dwTime = GetTickCount();
SendNowStateAllPlayer();
SendWarResultAllPlayer(); // 대전 시작 알림
}
else
GuildCombat1to1WarWait();
}
示例2: 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 ) );
}
示例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: __SetQuest
void __SetQuest( DWORD dwIdMover, int nQuest )
{
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuest );
CUser* pUser = prj.GetUser( dwIdMover );
if( pQuestProp )
pUser->AddDefinedText( TID_EVE_STARTQUEST, "\"%s\"", pQuestProp->m_szTitle );
QUEST quest;
if( pUser->SetQuest( nQuest, 0, &quest ) )
pUser->AddSetQuest( &quest );
g_dpDBClient.CalluspLoggingQuest( pUser->m_idPlayer, nQuest, 10 );
}
示例5: DoDuelResult
//
// 파티원들에게 bWin에 따라 승/패 사실을 알리고 듀얼을 종료시킴.
//
void CParty::DoDuelResult( CParty *pDuelOther, BOOL bWin, int nAddFame, float fSubFameRatio )
{
CUser *pMember;
int i;
for( i = 0; i < m_nSizeofMember; i ++ )
{
pMember = g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
if( IsValidObj( pMember ) )
{
pMember->AddDuelPartyResult( pDuelOther, bWin ); // 각 멤버들에게 승/패 사실을 알림. / 상대파티원 리스트도 보냄.
pMember->ClearDuelParty();
if( bWin )
{
pMember->m_nFame += nAddFame; // 이긴측이면 명성 증가
pMember->AddDefinedText( TID_GAME_GETFAMEPOINT, "%d", nAddFame ); // xxx 명성 포인트가 증가
#ifdef __WORLDSERVER
g_dpDBClient.SendLogPkPvp( pMember, NULL, nAddFame, 'E' );
#endif // __WORLDSERVER
}
else
{
int nDecVal;
fSubFameRatio = fSubFameRatio / 100.0f; // 비율로 환산.
nDecVal = (int)(pMember->m_nFame * fSubFameRatio);
if( nDecVal == 0 ) nDecVal = 1;
pMember->m_nFame -= nDecVal;
if( pMember->m_nFame < 0 ) pMember->m_nFame = 0;
pMember->AddDefinedText( TID_GAME_DECFAMEPOINT, "%d", nDecVal ); // xxx 명성 포인트가 감소.
#ifdef __WORLDSERVER
g_dpDBClient.SendLogPkPvp( NULL, pMember, nAddFame, 'E' );
#endif // __WORLDSERVER
}
// 바뀐 명성치를 pMember의 주위에 날려줌.
g_UserMng.AddSetFame( pMember, pMember->m_nFame );
}
}
m_idDuelParty = 0;
}
示例6: __SetQuestState
int __SetQuestState( DWORD dwIdMover, int nQuest, int nState )
{
CUser* pUser = prj.GetUser( dwIdMover );
if( nState == QS_END )
{
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuest );
if( pQuestProp )
{
if( nQuest != QUEST_CREGUILD )
pUser->AddDefinedText( TID_EVE_ENDQUEST, "\"%s\"", pQuestProp->m_szTitle );
}
g_dpDBClient.CalluspLoggingQuest( pUser->m_idPlayer, nQuest, 20 );
}
else
if( nState == QS_BEGIN )
{
g_dpDBClient.CalluspLoggingQuest( pUser->m_idPlayer, nQuest, 10 );
}
QUEST quest;
if( pUser->SetQuest( nQuest, nState, &quest ) )
pUser->AddSetQuest( &quest );
return 1;
}
示例7: CloseQuizEvent
void CQuiz::CloseQuizEvent()
{
SetRun( FALSE );
SetNextTime( 0 );
SetState( QE_CLOSE );
m_bSelectLog = FALSE;
m_nQuizCount = 0;
Clear();
RemoveNPC();
g_dpDBClient.SendQuizEventState( QE_CLOSE, g_uIdofMulti, 0, m_nQuizCount );
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_QUIZ );
if( pWorld )
{
for( DWORD i = 0; i < pWorld->m_dwObjNum; ++i )
{
if( IsInQuizEventPlayer( pWorld, nDefaultLayer, i ) )
GoOut( static_cast<CUser*>( pWorld->m_apObject[i] ) );
}
}
}
示例8: OpenQuizEvent
void CQuiz::OpenQuizEvent()
{
if( m_nState != QE_CLOSE )
return;
if( IsAutoMode() )
{
if( m_nChannel == g_uIdofMulti )
m_bRun = TRUE;
}
else
m_bRun = TRUE;
if( m_bRun )
{
InitQuizData( GetType() );
SetNPC();
SetNextTime( GetTickCount() + m_dwEntranceTime );
SetState( QE_OPEN );
g_dpDBClient.SendQuizEventState( QE_OPEN, g_uIdofMulti );
}
}
示例9: ExitInstance
void ExitInstance( void )
{
g_dpCoreSrvr.DeleteDPObject();
g_DPCacheSrvr.DeleteDPObject();
g_dpLoginSrvr.DeleteDPObject();
g_dpDatabaseClient.DeleteDPObject();
g_PartyMng.Clear();
g_PlayerMng.Free();
SAFE_DELETE( CParty::m_pPool );
SAFE_DELETE( CPlayer::m_pPool );
g_GuildMng.m_AddRemoveLock.Enter( theLineFile );
g_GuildWarMng.Clear();
g_GuildMng.m_AddRemoveLock.Leave( theLineFile );
g_GuildMng.Clear();
SAFE_DELETE( CGuildMember::sm_pPool );
SAFE_DELETE( CGuild::sm_pPool );
UninitializeNetLib();
}
示例10: 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' );
//.........这里部分代码省略.........
示例11: Process
void CQuiz::Process()
{
DWORD dwTick = GetTickCount();
vector<QUIZLIST>::iterator it = m_vecQuizList.begin();
switch( m_nState )
{
case QE_CLOSE:
// 퀴즈 이벤트 종료. 모든 유저 밖으로 이동
if( dwTick > GetNextTime() )
CloseQuizEvent();
break;
case QE_OPEN:
{
if( dwTick > GetNextTime() )
{
if( !m_vecQuizList.size() )
{
Error( "Quiz List Load Failed!" );
CloseQuizEvent();
return;
}
if( (int)( m_vecQuizList.size() ) < m_nQuizSize )
break;
BOOL bAble = FALSE;
int nUser = 0;
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_QUIZ );
if( pWorld )
{
for( DWORD i = 0; i < pWorld->m_dwObjNum; ++i )
{
if( IsInQuizEventPlayer( pWorld, nDefaultLayer, i ) )
{
static_cast<CUser*>( pWorld->m_apObject[i] )->AddQuizEventMessage( prj.GetText( TID_GAME_QUIZ_WAIT_QUESTION ) );
bAble = TRUE;
++nUser;
}
}
}
if( !bAble )
{
CloseQuizEvent();
return;
}
if( nUser <= LIMIT_USER_COUNT )
m_bSelectLog = TRUE;
SetNextTime( dwTick + m_dwWaitTime );
SetState( QE_QUESTION );
g_dpDBClient.SendQuizEventState( QE_QUESTION, g_uIdofMulti );
}
}
break;
case QE_QUESTION:
// 문제 출제
if( dwTick > GetNextTime() )
{
// UI
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_QUIZ );
if( pWorld )
{
for( DWORD i = 0; i < pWorld->m_dwObjNum; ++i )
{
if( IsInQuizEventPlayer( pWorld, nDefaultLayer, i ) )
{
static_cast<CUser*>( pWorld->m_apObject[i] )->AddQuizEventMessage( prj.GetText( TID_GAME_QUIZ_QUESTION ), QE_QUESTION );
static_cast<CUser*>( pWorld->m_apObject[i] )->AddQuizQuestion( GetType(), it->strQuestion, m_dwQuestionTime / SEC(1) );
}
}
}
SetNextTime( dwTick + m_dwQuestionTime );
SetState( QE_CORRECT_ANSWER );
g_dpDBClient.SendQuizEventState( QE_CORRECT_ANSWER, g_uIdofMulti );
++m_nQuizCount;
}
break;
case QE_CORRECT_ANSWER:
// 정답 공개
if( dwTick > GetNextTime() )
{
/* // 유저 이동 불가 - object
DWORD dwId = NULL;
if( GetType() == TYPE_OX )
dwId = 1116;
else
dwId = 1115;
m_pVObj = CreateObj( D3DDEVICE, OT_OBJ, dwId );
if( !m_pVObj )
return;
//.........这里部分代码省略.........
示例12: __EndQuest
//int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition = TRUE )
int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition )
{
int nNum;
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( pQuestProp )
{
CUser* pUser = prj.GetUser( nPcId );
if( IsEndQuestCondition )
{
if( __IsEndQuestCondition( pUser, nQuestId ) == 0 )
return FALSE;
}
// 보상 아이템 갯수 만큼, 인벤토리 여유가 있는가?
int nItemNum = 0;
for( int i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
}
}
if( nItemNum > pUser->m_Inventory.GetEmptyCount() )
{
pUser->AddDefinedText( TID_QUEST_NOINVENTORYSPACE ); // 인벤토리 공간이 없어서 퀘스트를 완료할 수 없습니다.
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_EXIT;
pUser->AddRunScriptFunc( rsf );
return FALSE;
}
////////////////////////////
// 보상 지급
////////////////////////////
for( i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
if( pEndRewardItem->m_nItemIdx )
{
int nItemNum = pEndRewardItem->m_nItemNum;
#ifdef __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption, pEndRewardItem->m_byFlag );
#else // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption );
#endif // __CHIPI_QUESTITEM_FLAG
#else // __JEFF_11
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum );
#endif // __JEFF_11
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
int nItemNum = pEndRewardItem->m_nItemNum;
#ifdef __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption, pEndRewardItem->m_byFlag );
#else // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption );
//.........这里部分代码省略.........
示例13: GetTickCount
// 1대1 길드대전 오픈
void CGuildCombat1to1Mng::GuildCombat1to1Open( BOOL bGMText )
{
if( !g_eLocal.GetState( EVE_GUILDCOMBAT1TO1 ) )
return;
vector<__GC1TO1TENDER>::iterator it;
if( !bGMText )
{
for( it=m_vecTenderFailGuild.begin(); it!=m_vecTenderFailGuild.end(); it++ )
{
// 이전 1:1길드대전에 입찰 실패 길드가 신청금을 수령하지 않았을 경우
g_dpDBClient.SendGC1to1Tender( 'U', (*it).ulGuildId, (*it).nPenya, 'N' );
}
m_vecTenderFailGuild.clear();
}
// 신청한 길드수가 최소 참여 길드수보다 적을 때
if( (int)( m_vecTenderGuild.size() ) < m_nMinJoinGuild )
{
// 1대1 길드대전 취소 및 연장 처리
CString strTemp;
strTemp.Format( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_NOGAME ), m_nMinJoinGuild );
g_DPCoreClient.SendCaption( strTemp );
ClearTime();
m_nState = GC1TO1_CLOSE;
return;
}
// 1:1길드대전 오픈 메세지..
g_DPCoreClient.SendCaption( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_OPEN ) );
g_DPCoreClient.SendCaption( prj.GetText( TID_GAME_GUILDCOMBAT1TO1_LINEUP ) );
// 참가자 구성 시간 설정
m_nState = GC1TO1_OPEN;
m_nWaitTime = (int)m_Lua.GetGlobalNumber( "MemberLineUpTime" );
m_dwTime = GetTickCount();
// 입찰 순위에 들지 못한 길드 제거
int nCount = 0;
for( it=m_vecTenderGuild.begin(); it!=m_vecTenderGuild.end(); )
{
nCount++;
if( nCount <= m_nMaxJoinGuild )
it++;
else // 입찰 순위에서 밀려난 경우
{
CGuild* pGuild = g_GuildMng.GetGuild( (*it).ulGuildId );
if( pGuild )
{
CUser* pUser = (CUser*)prj.GetUserByID( pGuild->m_idMaster );
if( IsValidObj( pUser ) )
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_FAILTENDER );
}
g_dpDBClient.SendGC1to1Tender( 'U', (*it).ulGuildId, (*it).nPenya, 'F' );
m_vecTenderFailGuild.push_back( (*it) );
it = m_vecTenderGuild.erase( it );
}
}
// 입찰 순위에는 들어갔지만 상대 길드가 없는 경우(홀수)
if( m_vecTenderGuild.size() % 2 != 0 )
{
it = m_vecTenderGuild.end(); it--; // 마지막 순위 // 노트 : rbegin()을 사용하시오.
CGuild* pGuild = g_GuildMng.GetGuild( (*it).ulGuildId );
if( pGuild )
{
CUser* pUser = (CUser*)prj.GetUserByID( pGuild->m_idMaster );
if( IsValidObj( pUser ) )
pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_FAILTENDER );
}
g_dpDBClient.SendGC1to1Tender( 'U', (*it).ulGuildId, (*it).nPenya, 'F' );
m_vecTenderFailGuild.push_back( (*it) );
m_vecTenderGuild.erase( it );
}
// 출전 가능한 길드의 모든 길드원에게 OPEN STATE 알림(길드 마스터는 참가자 구성 시간 출력)
for( it=m_vecTenderGuild.begin(); it!=m_vecTenderGuild.end(); it++ )
{
CGuild* pGuild = g_GuildMng.GetGuild( (*it).ulGuildId );
if( pGuild )
{
for( map<u_long, CGuildMember*>::iterator it2=pGuild->m_mapPMember.begin(); it2!=pGuild->m_mapPMember.end(); it2++ )
{
CUser* pUser = (CUser*)prj.GetUserByID( it2->first );
if( IsValidObj( pUser ) )
SendNowState( pUser );
}
}
}
g_dpDBClient.SendGC1to1StateToDBSrvr(); // 1:1길드대전이 오픈되었다고 DBServer에 알림
}
示例14: Run
void CRunObject::Run( void )
{
HANDLE hHeartbeat;
if( !( hHeartbeat = CreateEvent( NULL, FALSE, FALSE, g_sHeartbeat ) ) )
hHeartbeat = OpenEvent( EVENT_MODIFY_STATE, FALSE, g_sHeartbeat );
if( NULL == hHeartbeat )
Error( "MAPI_E_NOT_ENOUGH_RESOURCES" );
DWORD dwTickHearbeat = timeGetTime() + SEC( 2 );
CTimeout timeoutObject( 67, 0 );
CTimeout timeoutReadAgent( 67, 20 );
CTimeout timeoutReadCore( 67, 40 );
CTimeout timeoutReadTrans( 67, 50 );
CTimeout timeoutReadAccount( 67, 60 );
CTimeout timeoutRespawn( 1000, 200 );
CTimeout timeout( 1000, 600 );
#ifdef __EVENT_1101
CTimeout timeoutCallTheRoll( MIN( 1 ), 70 );
#endif // __EVENT_1101
DWORD dwCur, dwOld;
while( WaitForSingleObject( m_hClose, 1 ) != WAIT_OBJECT_0 )
{
{
_PROFILE( "CRunObject::Run()" );
g_tmCurrent = timeGetTime();
g_tCurrent = time( NULL );
dwCur = g_tmCurrent;
dwOld = dwCur;
if( timeoutObject.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "CWorldMng::Process()" );
g_WorldMng.Process();
if( g_tmCurrent > dwTickHearbeat )
{
SetEvent( hHeartbeat );
dwTickHearbeat = g_tmCurrent + SEC( 2 );
}
}
PROFILE_RUN( r1 );
if( timeoutReadAgent.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "g_DPSrvr.ReceiveMessage()" );
g_DPSrvr.ReceiveMessage();
}
PROFILE_RUN( r2 );
if( timeoutReadCore.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "g_DPCoreClient.ReceiveMessage()" );
g_DPCoreClient.ReceiveMessage();
}
PROFILE_RUN( r3 );
if( timeoutReadTrans.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "g_dpDBClient.ReceiveMessage()" );
g_dpDBClient.ReceiveMessage();
}
PROFILE_RUN( r4 );
/*
#ifdef __GIFTBOX0213
if( timeoutReadAccount.TimeoutReset( g_tmCurrent ) )
CDPAccountClient::GetInstance()->ReceiveMessage();
#endif // __GIFTBOX0213
*/
#ifdef __EVENTLUA_KEEPCONNECT
if( timeoutReadAccount.TimeoutReset( g_tmCurrent ) )
prj.m_EventLua.KeepConnectEventProcess();
#endif // __EVENTLUA_KEEPCONNECT
PROFILE_RUN( r5 );
if( timeoutRespawn.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "g_WorldMng.Respawn()" );
u_long uRespawned = g_WorldMng.Respawn();
// if( uRespawned > 0 )
SetLogInfo( LOGTYPE_RESPAWN, "Respawn:%d Object:%d", uRespawned, g_WorldMng.GetObjCount() );
}
PROFILE_RUN( r6 );
if( timeout.TimeoutReset( g_tmCurrent ) )
{
_PROFILE( "1SEC_Process" );
g_GameTimer.Compute();
CGuildQuestProcessor::GetInstance()->Process();
CPartyQuestProcessor::GetInstance()->Process();
PROFILE_RUN( r7 );
//.........这里部分代码省略.........
示例15: Init
BOOL CRunObject::Init( void )
{
if( LoadAIScript() == FALSE )
return FALSE;
//
m_hClose = CreateEvent( NULL, FALSE, FALSE, NULL );
DWORD dwThreadId;
m_hRunObject = chBEGINTHREADEX( NULL, 0, _Run, (LPVOID)this, 0, &dwThreadId );
//
/*
#ifdef __GIFTBOX0213
if( !CDPAccountClient::GetInstance()->ConnectToServer( s_szAccountAddr, PN_ACCOUNTSRVR_2, TRUE ) )
{
OutputDebugString( "Can't connect to account server." );
return FALSE;
}
CGiftboxMan::GetInstance()->Upload( CDPAccountClient::GetInstance() );
#endif // __GIFTBOX0213
*/
if( !g_DPSrvr.StartServer( (u_short)( g_uKey + PN_WORLDSRVR ), TRUE ) )
{
OutputDebugString( "Can't start server." );
return FALSE;
}
if( !g_DPCoreClient.Run( g_szCoreAddr, PN_CORESRVR + 0, g_uKey ) )
{
OutputDebugString( "Can't connect to core server." );
return FALSE;
}
if( !g_dpDBClient.ConnectToServer( g_szDBAddr, PN_DBSRVR_1, TRUE ) )
{
OutputDebugString( "Can't connect to database server." );
return FALSE;
}
if ( g_eLocal.GetState( ENABLE_GUILD_INVENTORY ) )
g_dpDBClient.SendQueryGuildBank();
if( g_eLocal.GetState( EVE_WORMON ) )
g_dpDBClient.SendQueryGuildQuest();
#if __VER >= 13 // __RAINBOW_RACE
if( g_eLocal.GetState( EVE_RAINBOWRACE ) )
g_dpDBClient.SendRainbowRaceReqLoad();
#endif // __RAINBOW_RACE
#ifdef __INVALID_LOGIN_0320
g_dpDBClient.CalluspXXXMultiServer( g_uIdofMulti, NULL );
#else // __INVALID_LOGIN_0320
g_dpDBClient.CalluspXXXMultiServer( g_uIdofMulti, 0 );
#endif // __INVALID_LOGIN_0320
if( !CXMasEvent::GetInstance()->LoadScript( "spevent.txt" ) )
{
OutputDebugString( "can't read spevent.txt" );
return FALSE;
}
if( g_eLocal.GetState( EVE_SCHOOL ) )
{
#ifdef __IDC
if( !CEveSchool::GetInstance()->LoadPos( "..\\script\\school.txt" ) ) //
#else // __IDC
if( !CEveSchool::GetInstance()->LoadPos( "school.txt" ) )
#endif // __IDC
{
OutputDebugString( "school.txt not found" );
return FALSE;
}
}
if( g_eLocal.GetState( EVE_GUILDCOMBAT ) && !g_GuildCombatMng.LoadScript( "GuildCombat.txt" ) )
{
OutputDebugString( "GuildCombat.txt not found" );
return FALSE;
}
#if __VER >= 12 // __ITEMCREATEMON_S0602
#if __VER < 12 // __NEW_ITEMCREATEMON_SERVER
if( !g_CreateMonster.LoadScript( "CreateMonster.txt" ) )
{
OutputDebugString( "CreateMonster.txt Not Found!" );
return FALSE;
}
#endif // __NEW_ITEMCREATEMON_SERVER
#endif // __ITEMCREATEMON_S0602
return TRUE;
}