本文整理汇总了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;
}