void EQEmuConfig::do_mailserver(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "host", true); if (text) { MailHost = text; } text = ParseTextBlock(ele, "port", true); if (text) { MailPort = atoi(text); } }
void EQEmuConfig::do_files(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "spells", true); if (text) { SpellsFile = text; } text = ParseTextBlock(ele, "opcodes", true); if (text) { OpCodesFile = text; } }
void EQEmuConfig::do_directories(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "maps", true); if (text) { MapDir = text; } text = ParseTextBlock(ele, "quests", true); if (text) { QuestDir = text; } text = ParseTextBlock(ele, "plugins", true); if (text) { PluginDir = text; } }
void EQEmuConfig::do_web_interface(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "port", true); if (text) WebInterfacePort = atoi(text); text = ParseTextBlock(ele, "cert", true); if (text) WebInterfaceCert = text; text = ParseTextBlock(ele, "priv_key", true); if (text) WebInterfacePrivKey = text; TiXmlElement *sub_ele = ele->FirstChildElement("ssl"); if (sub_ele != nullptr) { WebInterfaceUseSSL = true; } }
void EQEmuConfig::do_files(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "spells", true); if (text) { SpellsFile = text; } text = ParseTextBlock(ele, "opcodes", true); if (text) { OpCodesFile = text; } text = ParseTextBlock(ele, "logsettings", true); if (text) { LogSettingsFile = text; } text = ParseTextBlock(ele, "eqtime", true); if (text) { EQTimeFile = text; } }
void EQEmuConfig::do_launcher(TiXmlElement *ele) { const char *text; TiXmlElement *sub_ele; text = ParseTextBlock(ele, "logprefix", true); if (text) { LogPrefix = text; } text = ParseTextBlock(ele, "logsuffix", true); if (text) { LogSuffix = text; } // Get the <exe> element text = ParseTextBlock(ele, "exe", true); if (text) { ZoneExe = text; } // Get the <timers> element sub_ele = ele->FirstChildElement("timers"); if (sub_ele != nullptr) { text = sub_ele->Attribute("restart"); if (text) { RestartWait = atoi(text); } text = sub_ele->Attribute("reterminate"); if (text) { TerminateWait = atoi(text); } text = sub_ele->Attribute("initial"); if (text) { InitialBootWait = atoi(text); } text = sub_ele->Attribute("interval"); if (text) { ZoneBootInterval = atoi(text); } } }
void EQEmuConfig::do_qsdatabase(TiXmlElement *ele) { const char *text; text = ParseTextBlock(ele, "host", true); if (text) { QSDatabaseHost = text; } text = ParseTextBlock(ele, "port", true); if (text) { QSDatabasePort = atoi(text); } text = ParseTextBlock(ele, "username", true); if (text) { QSDatabaseUsername = text; } text = ParseTextBlock(ele, "password", true); if (text) { QSDatabasePassword = text; } text = ParseTextBlock(ele, "db", true); if (text) { QSDatabaseDB = text; } }
void EQEmuConfig::do_zones(TiXmlElement *ele) { const char *text; TiXmlElement *sub_ele; // TiXmlNode *node,*sub_node; text = ParseTextBlock(ele, "defaultstatus", true); if (text) { DefaultStatus = atoi(text); } // Get the <ports> element sub_ele = ele->FirstChildElement("ports"); if (sub_ele != nullptr) { text = sub_ele->Attribute("low"); if (text) { ZonePortLow = atoi(text); }; text = sub_ele->Attribute("high"); if (text) { ZonePortHigh = atoi(text); } } }
void EQEmuConfig::do_world(TiXmlElement *ele) { const char *text; TiXmlElement * sub_ele; text = ParseTextBlock(ele, "shortname"); if (text) { ShortName = text; } text = ParseTextBlock(ele, "longname"); if (text) { LongName = text; } text = ParseTextBlock(ele, "address", true); if (text) { WorldAddress = text; } text = ParseTextBlock(ele, "localaddress", true); if (text) { LocalAddress = text; } text = ParseTextBlock(ele, "maxclients", true); if (text) { MaxClients = atoi(text); } // Get the <key> element text = ParseTextBlock(ele, "key", true); if (text) { SharedKey = text; } // Get the <loginserver> element sub_ele = ele->FirstChildElement("loginserver"); if (sub_ele) { text = ParseTextBlock(sub_ele, "host", true); if (text) { LoginHost = text; } text = ParseTextBlock(sub_ele, "port", true); if (text) { LoginPort = atoi(text); } text = ParseTextBlock(sub_ele, "account", true); if (text) { LoginAccount = text; } text = ParseTextBlock(sub_ele, "password", true); if (text) { LoginPassword = text; } } else { char str[32]; do { sprintf(str, "loginserver%i", ++LoginCount); sub_ele = ele->FirstChildElement(str); if (sub_ele) { LoginConfig* loginconfig = new LoginConfig; text = ParseTextBlock(sub_ele, "host", true); if (text) { loginconfig->LoginHost = text; } text = ParseTextBlock(sub_ele, "port", true); if (text) { loginconfig->LoginPort = atoi(text); } text = ParseTextBlock(sub_ele, "account", true); if (text) { loginconfig->LoginAccount = text; } text = ParseTextBlock(sub_ele, "password", true); if (text) { loginconfig->LoginPassword = text; } loginlist.Insert(loginconfig); } } while (sub_ele); } // Check for locked sub_ele = ele->FirstChildElement("locked"); if (sub_ele != nullptr) { Locked = true; } // Get the <tcp> element sub_ele = ele->FirstChildElement("tcp"); if (sub_ele != nullptr) { text = sub_ele->Attribute("ip"); if (text) { WorldIP = text; } text = sub_ele->Attribute("port"); if (text) { WorldTCPPort = atoi(text); } text = sub_ele->Attribute("telnet"); if (text && !strcasecmp(text, "enabled")) { TelnetEnabled = true; } } // Get the <http> element sub_ele = ele->FirstChildElement("http"); if (sub_ele != nullptr) { // text = sub_ele->Attribute("ip"); // if (text) // WorldIP=text; text = sub_ele->Attribute("mimefile"); if (text) { WorldHTTPMimeFile = text; } text = sub_ele->Attribute("port"); if (text) { WorldHTTPPort = atoi(text); } text = sub_ele->Attribute("enabled"); if (text && !strcasecmp(text, "true")) { WorldHTTPEnabled = true; } } }