本文整理汇总了C++中CDPSrvr类的典型用法代码示例。如果您正苦于以下问题:C++ CDPSrvr类的具体用法?C++ CDPSrvr怎么用?C++ CDPSrvr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDPSrvr类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToggleDlgProc
BOOL CALLBACK ToggleDlgProc( HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam )
{
switch( iMessage )
{
case WM_INITDIALOG:
{
SetDlgItemText( hDlg, IDC_EDIT1, "Parent" );
SetDlgItemText( hDlg, IDC_EDIT2, "ID" );
break;
}
case WM_COMMAND:
switch( wParam )
{
case IDOK:
{
char lpString[MAX_PATH] = { 0, };
DWORD dwParent = 0;
DWORD dwID = 0;
GetDlgItemText( hDlg, IDC_EDIT3, lpString, MAX_PATH );
dwParent = atoi( lpString );
GetDlgItemText( hDlg, IDC_EDIT4, lpString, MAX_PATH );
dwID = atoi( lpString );
g_dpSrvr.EnableServer( dwParent, dwID, 1L );
EndDialog( hDlg, 0 );
return TRUE;
}
case IDCANCEL:
{
EndDialog( hDlg, 0 );
return TRUE;
}
case IDC_BUTTON_DISABLE:
{
char lpString[MAX_PATH] = { 0, };
DWORD dwParent = 0;
DWORD dwID = 0;
GetDlgItemText( hDlg, IDC_EDIT3, lpString, MAX_PATH );
dwParent = atoi( lpString );
GetDlgItemText( hDlg, IDC_EDIT4, lpString, MAX_PATH );
dwID = atoi( lpString );
g_dpSrvr.EnableServer( dwParent, dwID, 0L );
EndDialog( hDlg, 0 );
return TRUE;
}
}
break;
}
return FALSE;
}
示例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: OnTimer
void CBillingMgrJP::OnTimer( CAccount* pAccount )
{
if( pAccount->m_fCheck == m_iBillingFreePass ) // 무료사용자 skip
return;
CTime tm = 0;
if( pAccount->m_TimeOverDays == tm ) // login 미처리자 or timeover skip
return;
CTime cur = CTime::GetCurrentTime();
if( pAccount->m_TimeOverDays <= cur ) // timerover 처리
{
pAccount->m_TimeOverDays = 0;
g_dpSrvr.CloseExistingConnection( pAccount->m_lpszAccount, ERROR_BILLING_TIME_OVER );
}
else
{
// 남은 시간 통지
CTimeSpan ts = pAccount->m_TimeOverDays - cur;
if ( ts.GetTotalMinutes() >= 59 && ts.GetTotalMinutes() <= 61 &&
pAccount->m_nStatus != ACCOUNT_STATUS_NOTIFIED &&
pAccount->m_fRoute == TRUE )
{
pAccount->m_nStatus = ACCOUNT_STATUS_NOTIFIED;
g_dpDbSrvr.SendOneHourNotify( pAccount ); // TRANS에 보낸다.
}
}
}
示例4: ExitInstance
void ExitInstance( void )
{
#ifdef __BILLING0712
GetBillingMgr()->Release();
#endif
g_dpSrvr.DeleteDPObject();
g_dpDbSrvr.DeleteDPObject();
CDPAdbill::GetInstance()->DeleteDPObject();
/*
#ifdef __GIFTBOX0213
CDPWldSrvr::GetInstance()->DeleteDPObject();
#endif // __GIFTBOX0213
*/
g_AccountMng.Clear();
SAFE_DELETE( CAccount::m_pPool );
g_DbManager.CloseDbWorkers();
// UninitializeNetLib();
SAFE_DELETE( CAr::m_pHeapMng );
SAFE_DELETE( CBuffer::m_pPool );
SAFE_DELETE( CBuffer2::m_pPool2 );
SAFE_DELETE( CBuffer3::m_pPool2 );
SAFE_DELETE( CBuffer::m_pHeapMng );
UNLOAD_WS2_32_DLL;
}
示例5: __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 );
}
}
示例6:
// 입찰 취소
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;
}
}
}
}
示例7: 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 );
}
示例8: 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' );
//.........这里部分代码省略.........
示例9: 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 );
//.........这里部分代码省略.........
示例10: 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;
}
示例11: ExitInstance
void ExitInstance( void )
{
CRunObject::GetInstance()->Close();
/*
#ifdef __GIFTBOX0213
CDPAccountClient::GetInstance()->DeleteDPObject();
#endif // __GIFTBOX0213
*/
g_DPSrvr.DeleteDPObject();
g_DPCoreClient.DeleteDPObject();
g_dpDBClient.DeleteDPObject();
g_WorldMng.Free();
#ifndef __VM_0820
#ifndef __MEM_TRACE
SAFE_DELETE( CUser::m_pPool );
SAFE_DELETE( CMover::m_pPool );
SAFE_DELETE( CActionMover::m_pPool );
SAFE_DELETE( CAIMonster::m_pPool );
SAFE_DELETE( CItem::m_pPool );
#endif // __MEM_TRACE
#endif // __VM_0820
g_PartyMng.Clear();
#ifndef __VM_0820
#ifndef __MEM_TRACE
SAFE_DELETE( CParty::m_pPool );
#endif // __MEM_TRACE
#endif // __VM_0820
g_ChattingMng.Clear();
#ifndef __VM_0820
#ifndef __MEM_TRACE
SAFE_DELETE( CChatting::m_pPool );
#endif // __MEM_TRACE
#endif // __VM_0820
g_GuildWarMng.Clear();
g_GuildMng.Clear();
#if __VER >= 13 // __HOUSING
CHousingMng::GetInstance()->Clear();
#endif // __HOUSING
#ifndef __VM_0820
#ifndef __MEM_TRACE
SAFE_DELETE( CGuildMember::sm_pPool );
SAFE_DELETE( CGuild::sm_pPool );
SAFE_DELETE( CAIPet::m_pPool );
SAFE_DELETE( CAIKrrr::m_pPool );
SAFE_DELETE( CAIGuard::m_pPool );
SAFE_DELETE( CAIClockWorks::m_pPool );
SAFE_DELETE( CAIBigMuscle::m_pPool );
SAFE_DELETE( CAIBear::m_pPool );
#endif // __MEM_TRACE
#endif // __VM_0820
UninitializeNetLib();
UninitializeScriptLib();
#ifndef __VM_0820
#ifndef __MEM_TRACE
SAFE_DELETE( CAIPet::m_pPool );
#endif // __MEM_TRACE
#endif // __VM_0820
g_Object3DMng.Destroy();
prj.m_modelMng.DeleteDeviceObjects();
#if __VER >= 12 // __LORD
CSLord::Instance()->DestroyColleagues();
#endif // __LORD
}
示例12: 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 ) );
}
}
示例13: WndProc
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
#ifdef __BILLING0712
// 빌링에 관련된 윈도우 메세지가 처리되게 한다.
if( GetBillingMgr()->PreTranslateMessage( hWnd, message, wParam, lParam ) )
return 0;
#endif
switch (message)
{
case WM_TIMER:
{
switch( wParam )
{
case IDT_SENDPLAYERCOUNT:
g_dpDbSrvr.SendPlayerCount();
break;
case IDT_PREVENT_EXCESS:
g_AccountMng.PreventExcess();
break;
case IDT_TIME_CHECKADDR:
{
if( g_dpSrvr.m_bCheckAddr && g_AccountMng.IsTimeCheckAddr() )
{
HMENU hMenu = GetMenu( hWnd );
CheckMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_CHECKED );
EnableMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_DISABLED | MF_GRAYED );
CheckMenuItem( hMenu, IDM_OPT_INTERNAL, MF_UNCHECKED );
EnableMenuItem( hMenu, IDM_OPT_INTERNAL, MF_ENABLED );
g_dpSrvr.m_bCheckAddr = false;
}
}
break;
/*
#ifdef __S0114_RELOADPRO
case IDT_RELOAD_PROJECT:
{
if( g_dpSrvr.m_bReloadPro )
g_DbManager.Load_ReloadAccount();
}
break;
#endif // __S0114_RELOADPRO
*/
case IDT_BUYING_INFO:
CBuyingInfoMng::GetInstance()->Process();
break;
}
}
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_EXIT:
DestroyWindow(hWnd);
break;
case IDM_OPT_INTERNAL:
{
HMENU hMenu = GetMenu( hWnd );
CheckMenuItem( hMenu, IDM_OPT_INTERNAL, MF_CHECKED );
EnableMenuItem( hMenu, IDM_OPT_INTERNAL, MF_DISABLED | MF_GRAYED );
CheckMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_UNCHECKED );
EnableMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_ENABLED );
g_dpSrvr.m_bCheckAddr = true;
break;
}
case IDM_OPT_EXTERNAL:
{
HMENU hMenu = GetMenu( hWnd );
CheckMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_CHECKED );
EnableMenuItem( hMenu, IDM_OPT_EXTERNAL, MF_DISABLED | MF_GRAYED );
CheckMenuItem( hMenu, IDM_OPT_INTERNAL, MF_UNCHECKED );
EnableMenuItem( hMenu, IDM_OPT_INTERNAL, MF_ENABLED );
g_dpSrvr.m_bCheckAddr = false;
break;
}
case IDM_OPT_MAX_CONN:
{
DialogBox( hInst, MAKEINTRESOURCE( IDD_DIALOG_MAX_CONN ), hWnd, MaxConnDlgProc );
break;
}
case IDM_OPT_TOGGLE:
{
DialogBox( hInst, MAKEINTRESOURCE( IDD_DIALOG_TOGGLE ), hWnd, ToggleDlgProc );
break;
}
case IDM_OPT_SETTIME:
{
DialogBox( hInst, MAKEINTRESOURCE( IDD_DIALOG_TIME ), hWnd, SetTimeDlgProc );
break;
}
case IDM_OPT_INTERNAL_IP:
{
//.........这里部分代码省略.........
示例14: InitInstance
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
#ifndef _DEBUG
// InitEH();
#endif // _DEBUG
#ifdef __BILLING0712
if( ::CreateBillingMgr() == FALSE ) // CreateWindow전에 호출되어야 한다.
return FALSE;
#endif
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hMainWnd = hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if( !hWnd )
return FALSE;
HMENU hMenu = GetMenu( hWnd );
CheckMenuItem( hMenu, IDM_OPT_INTERNAL, MF_CHECKED );
EnableMenuItem( hMenu, IDM_OPT_INTERNAL, MF_DISABLED | MF_GRAYED );
g_dpSrvr.m_bCheckAddr = true;
int x = 400, y = 416;
SetWindowPos( hWnd, NULL, x, y, 400, 416, SWP_SHOWWINDOW );
LOAD_WS2_32_DLL;
::srand( timeGetTime() );
// Script함수의 호출순서가 중요하다. (menu -> script -> createdbworker)
if( Script( "AccountServer.ini" ) == FALSE )
return FALSE;
#ifdef __SECURITY_0628
LoadResAuth( "Flyff.b" );
#endif // __SECURITY_0628
// if( CQuery::EnableConnectionPooling() )
// OutputDebugString( "EnableConnectionPooling\n" );
g_DbManager.CreateDbWorkers();
if( g_dpSrvr.LoadAddrPmttd( "pmttd.ini" ) == false )
{
TRACE("LoadAddrPmttd false\n");
}
if( g_dpSrvr.LoadIPCut( "IPCut.ini" ) == FALSE )
{
TRACE( "LoadIPCut FALSE\n" );
}
g_MyTrace.Initialize( hWnd, "SquireD", RGB( 0x00, 0x00, 0x00 ), RGB( 0xff, 0xff, 0xff ) );
CTime time = CTime::GetCurrentTime();
g_MyTrace.Add( 0, FALSE, "%s", time.Format( "%Y/%m/%d %H:%M:%S" ) );
g_MyTrace.AddLine( '\0' );
if( FALSE == g_dpSrvr.StartServer( PN_ACCOUNTSRVR_0 )
|| FALSE == g_dpDbSrvr.StartServer( PN_ACCOUNTSRVR_1 )
|| FALSE == CDPAdbill::GetInstance()->StartServer( PN_ADBILL )
/*
#ifdef __GIFTBOX0213
|| FALSE == CDPWldSrvr::GetInstance()->StartServer( PN_ACCOUNTSRVR_2 )
#endif // __GIFTBOX0213
*/
)
{
AfxMessageBox( "Unable to start server" );
return FALSE;
}
#ifdef __BILLING0712
if( GetBillingMgr()->Init( hWnd ) == false )
return FALSE;
#endif
SetTimer( hWnd, IDT_SENDPLAYERCOUNT, 1000 * 60, NULL );
SetTimer( hWnd, IDT_TIME_CHECKADDR, 1000 * 30, NULL );
if( ::GetLanguage() == LANG_THA )
SetTimer( hWnd, IDT_PREVENT_EXCESS, 1000 * 60, NULL );
/*
#ifdef __S0114_RELOADPRO
SetTimer( hWnd, IDT_RELOAD_PROJECT, 1000 * 30, NULL );
#endif // __S0114_RELOADPRO
*/
SetTimer( hWnd, IDT_BUYING_INFO, 500, NULL );
if( FALSE == g_DbManager.AllOff() )
return FALSE;
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}