本文整理汇总了C++中VarList::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ VarList::Count方法的具体用法?C++ VarList::Count怎么用?C++ VarList::Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VarList
的用法示例。
在下文中一共展示了VarList::Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
bool NetSystem::Initialize() {
if (NULL == (m_pKernel = Kernel::Employ()) ||
NULL == (m_pCallBackSystem = CallBackSystem::Employ()) ||
NULL == (m_pConfigManage = ConfigManage::Employ()) ||
NULL == (m_pObjectManage = ObjectManage::Employ()) ||
NULL == (m_pHeartBeatManage = HeartBeatManage::Employ()) ||
NULL == (m_pLogSystem = LogSystem::Employ())) {
LOG_ERROR("NetSystem initialize failed");
Assert(false);
return false;
}
m_alive = true;
const CIniConfig * globlaconfig = m_pConfigManage->GetConfig(KERNEL_CONFIG_GLOBLA_INI);
if (NULL == globlaconfig) {
LOG_ERROR("Get GloblaConfig Failed");
Assert(false);
return false;
}
const char * pStrServerTypes = globlaconfig->GetStringConfig("Global", "ServerTypes");
if ("" == string(pStrServerTypes)) {
LOG_ERROR("Get ServerTypes Failed");
Assert(false);
return false;
}
VarList types;
SafeSplitString(pStrServerTypes, ";", types);
UI32 nCount = types.Count();
if (0 >= nCount) {
LOG_ERROR("Count Of ServerTypes : 0");
Assert(0);
return false;
}
for (UI32 i = 0; i < nCount; i++) {
m_linkmanage.AddLinkType(types.GetString(i));
}
const CIniConfig * baseconfig = m_pConfigManage->GetConfig(KERNEL_CONFIG_BASE_INI);
if (NULL == baseconfig) {
LOG_ERROR("Get BaseConfig failed ");
Assert(false);
return false;
}
const char * pstartlisten = baseconfig->GetStringConfig("Base", "Listen");
if (pstartlisten != NULL && strlen(pstartlisten) != 0) {
VarList lslist;
SafeSplitString(pstartlisten, ";", lslist);
nCount = lslist.Count();
for (UI32 i = 0; i < nCount; i++) {
VarList listeninfo;
SafeSplitString(lslist.GetString(i), ",", listeninfo);
if (listeninfo.Count() != 3) {
LOG_ERROR("Check the format of you listen config : %s", lslist.GetString(i));
Assert(false);
return false;
}
Listen(listeninfo.GetString(0), listeninfo.GetString(1), StringAsInt(listeninfo.GetString(2)), LISTEN_GAME_SOCKET);
}
}
const char * pstartconnects = baseconfig->GetStringConfig("Base", "Connect");
if (pstartconnects != NULL && strlen(pstartconnects) != 0) {
VarList connects;
SafeSplitString(pstartconnects, ";", connects);
nCount = connects.Count();
for (UI32 i = 0; i < nCount; i++) {
VarList connectinfo;
SafeSplitString(connects.GetString(i), ",", connectinfo);
if (connectinfo.Count() != 3) {
LOG_ERROR("Check the format of you connect config : %s", connects.GetString(i));
Assert(false);
return false;
}
Connect(connectinfo.GetString(0), connectinfo.GetString(1), StringAsInt(connectinfo.GetString(2)));
}
}
const char * pConsolelisten = baseconfig->GetStringConfig("Base", "Console");
if (pConsolelisten != NULL && strlen(pConsolelisten) != 0) {
VarList csllist;
SafeSplitString(pConsolelisten, ";", csllist);
nCount = csllist.Count();
for (UI32 i = 0; i < nCount; i++) {
VarList listeninfo;
SafeSplitString(csllist.GetString(i), ",", listeninfo);
if (listeninfo.Count() != 3) {
LOG_ERROR("Check the format of you listen config : %s", csllist.GetString(i));
Assert(false);
return false;
}
Listen(listeninfo.GetString(0), listeninfo.GetString(1), StringAsInt(listeninfo.GetString(2)), LISTEN_CONSOLE_SOCKET);
}
}
//.........这里部分代码省略.........