当前位置: 首页>>代码示例>>C++>>正文


C++ CDPSrvr::LoadIPCut方法代码示例

本文整理汇总了C++中CDPSrvr::LoadIPCut方法的典型用法代码示例。如果您正苦于以下问题:C++ CDPSrvr::LoadIPCut方法的具体用法?C++ CDPSrvr::LoadIPCut怎么用?C++ CDPSrvr::LoadIPCut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDPSrvr的用法示例。


在下文中一共展示了CDPSrvr::LoadIPCut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WndProc


//.........这里部分代码省略.........
							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:
					{
						g_dpSrvr.LoadAddrPmttd( "pmttd.ini" );
						g_dpSrvr.LoadIPCut( "IPCut.ini" );
						break;
					}
				default:
				   return DefWindowProc(hWnd, message, wParam, lParam);
			}
			break;

		case WM_PAINT:
			hdc = BeginPaint(hWnd, &ps);
			g_MyTrace.Paint( hdc );
			EndPaint(hWnd, &ps);
			break;

		case WM_DESTROY:
			KillTimer( hMainWnd, IDT_SENDPLAYERCOUNT );
			if( ::GetLanguage() == LANG_THA )
				KillTimer( hMainWnd, IDT_PREVENT_EXCESS );
/*
#ifdef __S0114_RELOADPRO
			KillTimer( hMainWnd, IDT_RELOAD_PROJECT );
#endif // __S0114_RELOADPRO
*/
			PostQuitMessage(0);
			break;

		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
   }
   return 0;
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:101,代码来源:AccountServer.cpp

示例2: 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;
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:96,代码来源:AccountServer.cpp


注:本文中的CDPSrvr::LoadIPCut方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。