本文整理汇总了C++中PluginManager::start方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginManager::start方法的具体用法?C++ PluginManager::start怎么用?C++ PluginManager::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
std::cerr << "Main begin " << std::endl;
Context *context = Context::GetContext();
context->setScreenWidth(800);
context->setScreenHeight(600);
context->setScreenXOffset(0);
context->setScreenYOffset(0);
xlibEnv::xlibEnv::GetXlibEnv(context);
PluginManager *pluginMgr = PluginManager::GetManager(
context);
context->setPluginManager(pluginMgr);
pluginMgr->start();
openGlPaintPlugin *openglpaintplugin =
new openGlPaintPlugin(context);
context->setOpenGlPaintPlugin(openglpaintplugin);
ParseEvent *parseEvent = ParseEvent::GetParseEvent(context);
context->setEventParse(parseEvent);
//parseEvent.parseFile2Event("/home/lnmcc/Documents/test.json");
//parseEvent.parseFile2Event("/home/lnmcc/Documents/test2.json");
//parseEvent.parseFile2Event("/home/lnmcc/Documents/test3.json");
//parseEvent.parseFile2Event("/home/lnmcc/Documents/test4.json");
//parseEvent->dump();
parseEvent->start();
Socket mysocket(context);
mysocket.start();
//openglpaintplugin->setThreadPriority(99);
openglpaintplugin->start();
pause();
return 0;
}
示例2: main
int main(int argc, char **argv)
{
Settings *mySettings = Settings::getSettings();
mySettings->readArgs(argc, argv);
if(mySettings->get("NEVER_START") != "!"){
if(!mySettings->readConfFile()){
std::string savedloglevel = mySettings->get("log_level");
mySettings->set("log_level", "3");
Logger::getLogger()->error("Could not read config file");
mySettings->set("log_level", savedloglevel);
}
if(mySettings->get("DEBUG") != "!"){
daemonize();
}else{
signal(SIGINT, sigIntHandler);
signal(SIGTERM, sigIntHandler);
signal(SIGPIPE, SIG_IGN);
mySettings->set("log_console", "yes");
}
Logger *myLogger = Logger::getLogger();
myLogger->info("Tpserver-cpp " VERSION " starting");
myLogger->info("This is GPL software, please see the COPYING file");
try{
Game *myGame = Game::getGame();
PluginManager* myPlugins = PluginManager::getPluginManager();
myPlugins->start();
try{
std::string tpschemename = mySettings->get("tpscheme");
if(tpschemename == "auto" || tpschemename == ""){
//Temp. should be able to do better than this.
if(myPlugins->loadTpScheme("tpguile")){
myLogger->info("Loaded TpScheme tpguile");
}else{
myLogger->warning("Did not load TpScheme \"tpguile\", trying tpmzscheme");
if(myPlugins->loadTpScheme("tpmzscheme")){
myLogger->info("Loaded TpScheme tpmzscheme");
}else{
myLogger->warning("Did not load TpScheme \"tpmzscheme\"");
}
}
}else{
myLogger->info("Loading TpScheme %s", tpschemename.c_str());
if(myPlugins->loadTpScheme(tpschemename)){
myLogger->info("Loaded TpScheme %s", tpschemename.c_str());
}else{
myLogger->warning("Did not load TpScheme \"%s\"", tpschemename.c_str());
}
}
std::string persistencename = mySettings->get("persistence");
if(persistencename != ""){
myLogger->info("Loading persistence method %s", persistencename.c_str());
if(myPlugins->loadPersistence(persistencename)){
myLogger->info("Loaded persistence method %s", persistencename.c_str());
}else{
myLogger->warning("Did not load persistence method \"%s\"", persistencename.c_str());
}
}
std::string rulesetname = mySettings->get("ruleset");
if(rulesetname != ""){
myLogger->info("Loading ruleset %s", rulesetname.c_str());
if(myPlugins->loadRuleset(rulesetname)){
myLogger->info("Loaded ruleset %s", rulesetname.c_str());
}else{
myLogger->warning("Did not load ruleset \"%s\"", rulesetname.c_str());
}
}
if(mySettings->get("game_load") == "yes"){
myGame->load();
}
if(mySettings->get("game_start") == "yes"){
myGame->start();
}
Network *myNetwork = Network::getNetwork();
if(mySettings->get("network_start") == "yes"){
myNetwork->start();
}
myNetwork->masterLoop();
if(myNetwork->isStarted()){
myNetwork->stop();
}
//.........这里部分代码省略.........