本文整理汇总了C++中LauncherList::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ LauncherList::Add方法的具体用法?C++ LauncherList::Add怎么用?C++ LauncherList::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LauncherList
的用法示例。
在下文中一共展示了LauncherList::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
RegisterExecutablePlatform(ExePlatformWorld);
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
/* Database Version Check */
uint32 Database_Version = CURRENT_BINARY_DATABASE_VERSION;
uint32 Bots_Database_Version = CURRENT_BINARY_BOTS_DATABASE_VERSION;
if (argc >= 2) {
if (strcasecmp(argv[1], "db_version") == 0) {
std::cout << "Binary Database Version: " << Database_Version << " : " << Bots_Database_Version << std::endl;
return 0;
}
}
// Load server configuration
Log(Logs::General, Logs::World_Server, "Loading server configuration..");
if (!WorldConfig::LoadConfig()) {
Log(Logs::General, Logs::World_Server, "Loading server configuration failed.");
return 1;
}
Config = WorldConfig::get();
Log(Logs::General, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
return 1;
}
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
return 1;
}
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
return 1;
}
#endif
// add login server config to list
if (Config->LoginCount == 0) {
if (Config->LoginHost.length()) {
loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str(), Config->LoginLegacy);
Log(Logs::General, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
}
}
else {
LinkedList<LoginConfig*> loginlist = Config->loginlist;
LinkedListIterator<LoginConfig*> iterator(loginlist);
iterator.Reset();
while (iterator.MoreElements()) {
loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str(),
iterator.GetData()->LoginLegacy);
Log(Logs::General, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
iterator.Advance();
}
}
Log(Logs::General, Logs::World_Server, "Connecting to MySQL...");
if (!database.Connect(
Config->DatabaseHost.c_str(),
Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(),
Config->DatabaseDB.c_str(),
Config->DatabasePort)) {
Log(Logs::General, Logs::World_Server, "Cannot continue without a database connection.");
return 1;
}
guild_mgr.SetDatabase(&database);
/* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
bool ignore_db = false;
if (argc >= 2) {
std::string tmp;
if (strcasecmp(argv[1], "help") == 0 || strcasecmp(argv[1], "?") == 0 || strcasecmp(argv[1], "/?") == 0 || strcasecmp(argv[1], "-?") == 0 || strcasecmp(argv[1], "-h") == 0 || strcasecmp(argv[1], "-help") == 0) {
std::cout << "Worldserver command line commands:" << std::endl;
std::cout << "adduser username password flag - adds a user account" << std::endl;
std::cout << "flag username flag - sets GM flag on the account" << std::endl;
std::cout << "startzone zoneshortname - sets the starting zone" << std::endl;
std::cout << "-holdzones - reboots lost zones" << std::endl;
return 0;
}
else if (strcasecmp(argv[1], "-holdzones") == 0) {
std::cout << "Reboot Zones mode ON" << std::endl;
holdzones = true;
}
else if (database.GetVariable("disablecommandline", tmp)) {
if (tmp.length() == 1) {
if (tmp[0] == '1') {
std::cerr << "Command line disabled in database... exiting" << std::endl;
return 1;
}
}
//.........这里部分代码省略.........