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


C++ StatusUpdate::AddOutputChain方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
   parser.FindValue( "server.name", serverName );

   parser.FindValue( "chat.port", chatPortString );
   parser.FindValue( "chat.address", chatIpAddressString );

   parser.FindValue( "agricola.address", agricolaPortString );
   parser.FindValue( "agricola.port", agricolaIpAddressString );

   parser.FindValue( "user.products_update", enableUserProducts );
   parser.FindValue( "user.uuid_fix_only", userUuidFixOnly );


   string dbPortString = "16384";
   string dbIpAddress = "localhost";
   string dbUsername = "root";
   string dbPassword = "password";
   string dbSchema = "playdek";

   parser.FindValue( "db.address", dbIpAddress );
   parser.FindValue( "db.port", dbPortString );
   parser.FindValue( "db.username", dbUsername );
   parser.FindValue( "db.password", dbPassword );
   parser.FindValue( "db.schema", dbSchema );


   bool enableAddingUserProducts = false;
   bool onlyUpdatesUuid = false;
   int chatPort = 9602, dbPortAddress = 3306, agricolaPort = 23996;
   try 
   {
       //listenPort = boost::lexical_cast<int>( listenPortString );
       chatPort = boost::lexical_cast<int>( chatPortString );
       agricolaPort = boost::lexical_cast<int>( agricolaPortString );
       dbPortAddress = boost::lexical_cast<int>( dbPortString );

       if( enableUserProducts.size() )
       {
          enableAddingUserProducts = ( enableUserProducts == "true" || enableUserProducts == "1" );
       }
       if( userUuidFixOnly.size() )
       {
          onlyUpdatesUuid = ( userUuidFixOnly == "true" || userUuidFixOnly == "1" );
       }
   } 
   catch( boost::bad_lexical_cast const& ) 
   {
       std::cout << "Error: input string was not valid" << std::endl;
       LogMessage(LOG_PRIO_ERR, "Error: input string was not valid\n");
   }

   //--------------------------------------------------------------


   U64 serverUniqueHashValue = GenerateUniqueHash( serverName );
   U32 serverId = (U32)serverUniqueHashValue;

   cout << serverName << endl;
   cout << "Server stack version " << ServerStackVersion << endl;
   cout << "ServerId " << serverId << endl;
   cout << "Network protocol version: " << (int)NetworkVersionMajor << ":" << (int)NetworkVersionMinor << endl;
   
   cout << "------------------------------------------------------------------" << endl << endl << endl;
   LogMessage(LOG_PRIO_ERR, "serverName\n");
   LogMessage(LOG_PRIO_ERR, "Server stack version %s\n", ServerStackVersion );
   LogMessage(LOG_PRIO_ERR, "ServerId %d\n", serverId);
   LogMessage(LOG_PRIO_ERR, "------------------------------------------------------------------\n\n\n");

   StatusUpdate* server = new StatusUpdate( serverName, serverId );

   //----------------------------------------------------------------
   if( Database::ConnectToMultipleDatabases< StatusUpdate > ( parser, server ) == false )
   {
      Database::Deltadromeus* delta = new Database::Deltadromeus;
      delta->SetConnectionInfo( dbIpAddress, dbPortAddress, dbUsername, dbPassword, dbSchema );
      delta->SetConnectionType( Database::Deltadromeus::DbConnectionType_All );
      if( delta->IsConnected() == false )
      {
         cout << "Error: Database connection is invalid." << endl;
         getch();
         return 1;
      }
      server->AddOutputChain( delta );
   }

   //----------------------------------------------------------------

   server->EnableAddingUserProducts( enableAddingUserProducts );
   server->SetAsServicingUuidOnly( onlyUpdatesUuid );
   
   server->Init();
   server->Resume();

   //getch();
   while( 1 ) // infinite loop
   {
      Sleep( 1000 );
   }
   
	return 0;
}
开发者ID:mkawick,项目名称:ChatResearch,代码行数:101,代码来源:Accounts.cpp


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