本文整理汇总了C++中CDPCacheSrvr::StartServer方法的典型用法代码示例。如果您正苦于以下问题:C++ CDPCacheSrvr::StartServer方法的具体用法?C++ CDPCacheSrvr::StartServer怎么用?C++ CDPCacheSrvr::StartServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDPCacheSrvr
的用法示例。
在下文中一共展示了CDPCacheSrvr::StartServer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitInstance
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
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;
SetTimer( hMainWnd, 3, SEC( 60 ), NULL ); // 10(s)
int x = 480, y = 606;
SetWindowPos( hWnd, NULL, x, y, 400, 416, SWP_SHOWWINDOW );
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' );
#ifndef _DEBUG
// InitEH();
#endif // _DEBUG
if( !Script( "CacheServer.ini" ) )
return FALSE;
if( InitializeNetLib() == FALSE )
return FALSE;
if( !g_DPCoreClient.ConnectToServer( g_szCoreAddr, PN_CORESRVR + 1 ) )
return FALSE;
#ifdef __CRC
if( !g_DPCacheSrvr.StartServer( g_uPort, FALSE, CSock::crcRead ) )
#else // __CRC
if( !g_DPCacheSrvr.StartServer( g_uPort ) )
#endif // __CRC
return FALSE;
g_MyTrace.AddLine( '-' );
char lpszIpAddr[16];
g_DPCoreClient.GetPlayerAddr( DPID_SERVERPLAYER, lpszIpAddr );
g_MyTrace.Add( CMyTrace::Key( "main" ), FALSE, "%s", lpszIpAddr );
g_MyTrace.AddLine( '-' );
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
示例2: InitInstance
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
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;
}
int x = 0, y = 416;
SetWindowPos( hWnd, NULL, x, y, 400, 416, SWP_SHOWWINDOW );
g_GameTimer.Compute();
SetTimer( hWnd, TIMER_ID_DEFAULT, 1000, NULL );
#if !defined(__INTERNALSERVER)
SetTimer( hWnd, TIMER_ID_WANTED, g_uWantedElapse, NULL );
#endif
#ifdef __EVENT0913
SetTimer( hWnd, TIMER_ID_EVENT0913, 1000, NULL );
#endif // __EVENT0913
#ifdef __EVENT1206
SetTimer( hWnd, TIMER_ID_EVENT1206, 1000 * 60, NULL );
#endif // __EVENT1206
SetTimer( hWnd, TIMER_ID_EVENT, 1000 * 60, NULL );
g_MyTrace.Initialize( hWnd, "SquireD", RGB( 0xff, 0xff, 0xff ), RGB( 0x00, 0x00, 0x00 ) );
CTime time = CTime::GetCurrentTime();
g_MyTrace.Add( 0, FALSE, "%s", time.Format( "%Y/%m/%d %H:%M:%S" ) );
g_MyTrace.AddLine( '\0' );
#ifndef _DEBUG
// InitEH();
#endif // _DEBUG
g_TickCount.Start();
if( !Script( "CoreServer.ini" ) )
{
return FALSE;
}
if( InitializeNetLib() == FALSE )
return FALSE;
if( !g_dpCoreSrvr.StartServer( PN_CORESRVR + 0 ) )
return FALSE;
if( !g_DPCacheSrvr.StartServer( PN_CORESRVR + 1 ) )
return FALSE;
if( !g_dpLoginSrvr.StartServer( PN_CORESRVR + 2 ) )
return FALSE;
if( !g_dpDatabaseClient.ConnectToServer( szDataBaseAddr, PN_DBSRVR_2, FALSE ) )
{
Error( "Not TransServer Connect" );
return FALSE;
}
if( !g_PartyMng.CreateWorkers() )
{
assert( 0 );
}
#ifdef __ENVIRONMENT_EFFECT
if( CEnvironment::GetInstance()->CreateWorkers() == FALSE )
{
assert( 0 );
}
#else // __ENVIRONMENT_EFFECT
if( !g_Environment.CreateWorkers() )
{
assert( 0 );
}
#endif // __ENVIRONMENT_EFFECT
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}