本文整理汇总了C++中GuildMember::setOnline方法的典型用法代码示例。如果您正苦于以下问题:C++ GuildMember::setOnline方法的具体用法?C++ GuildMember::setOnline怎么用?C++ GuildMember::setOnline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuildMember
的用法示例。
在下文中一共展示了GuildMember::setOnline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateList
void GuildManager::updateList()
{
Guild *guild = Guild::getGuild(1);
if (guild)
{
guild->setServerGuild(false);
StringVectCIter it = mTempList.begin();
StringVectCIter it_end = mTempList.end();
int i = 0;
while (it != it_end)
{
std::string name = *it;
if (name.size() > 1)
{
int status = atoi(name.substr(name.size() - 1).c_str());
name = name.substr(0, name.size() - 1);
GuildMember *m = guild->addMember(i, 0, name);
if (m)
{
m->setOnline(status & 1);
m->setGender(GENDER_UNSPECIFIED);
if (status & 2)
m->setPos(10);
else
m->setPos(0);
if (player_node && name == player_node->getName())
{
mHavePower = (status & 2);
m->setOnline(true);
}
}
}
++ it;
i ++;
}
guild->sort();
createTab(guild);
if (actorSpriteManager)
{
actorSpriteManager->updatePlayerGuild();
actorSpriteManager->updatePlayerColors();
}
}
mTempList.clear();
mSentInfoRequest = false;
mGotInfo = true;
}
示例2: process
bool GuildManager::process(std::string msg)
{
if (msg.size() > 4 && msg[0] == '#' && msg[1] == '#')
msg = msg.substr(3);
bool haveNick = (msg.find(": ") != std::string::npos);
if (!haveNick && findCutLast(msg, " is now Offline."))
{
Guild *guild = createGuild();
if (!guild)
return false;
if (msg.size() < 4)
return false;
if (msg[0] == '#' && msg[1] == '#')
msg = msg.substr(3);
GuildMember *m = guild->addMember(msg);
if (m)
m->setOnline(false);
guild->sort();
mRequest = false;
return true;
}
else if (!haveNick && findCutLast(msg, " is now Online."))
{
Guild *guild = createGuild();
if (!guild)
return false;
if (msg.size() < 4)
return false;
if (msg[0] == '#' && msg[1] == '#')
msg = msg.substr(3);
GuildMember *m = guild->addMember(msg);
if (m)
m->setOnline(true);
guild->sort();
mRequest = false;
return true;
}
else if (findCutFirst(msg, "Welcome to the "))
{
Guild *guild = createGuild();
if (!guild)
return false;
// logger->log("welcome message: %s", msg.c_str());
size_t pos = msg.find("! (");
if (pos == std::string::npos)
return false;
msg = msg.substr(0, pos);
guild->setName(msg);
if (player_node)
player_node->setGuildName(msg);
mGotName = true;
mSentNameRequest = false;
mRequest = false;
return true;
}
else if (findCutFirst(msg, "Player name: "))
{
Guild *guild = createGuild();
if (!guild)
return false;
size_t pos = msg.find("Access Level: ");
if (pos == std::string::npos)
return false;
msg = msg.substr(pos);
if (!findCutFirst(msg, "Access Level: "))
return false;
pos = msg.find(", Guild:");
if (pos == std::string::npos)
return false;
int level = atoi(msg.substr(0, pos).c_str());
if (level >= 10)
mHavePower = true;
else
mHavePower = false;
msg = msg.substr(pos + strlen(", Guild:"));
pos = msg.find(", No. Of Online Players: ");
if (pos == std::string::npos)
return false;
msg = msg.substr(0, pos);
// logger->log("guild name: %s", msg.c_str());
guild->setName(msg);
if (player_node)
player_node->setGuildName(msg);
mGotName = true;
mSentNameRequest = false;
mRequest = false;
return true;
}
else if (findCutFirst(msg, "OL#"))
{
// logger->log("OL");
//.........这里部分代码省略.........