本文整理汇总了C++中user::Ptr::setNick方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::setNick方法的具体用法?C++ Ptr::setNick怎么用?C++ Ptr::setNick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user::Ptr
的用法示例。
在下文中一共展示了Ptr::setNick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
void AdcHub::handle(Command::INF, Command& c) throw() {
if(c.getFrom().isZero() || c.getParameters().empty())
return;
User::Ptr u = ClientManager::getInstance()->getUser(c.getFrom(), this, true);
int op = 0;
int reg = 0;
int norm = 0;
string ve;
int sl = 0;
for(StringIterC i = c.getParameters().begin(); i != c.getParameters().end(); ++i) {
if(i->length() < 2)
continue;
if(i->compare(0, 2, "NI") == 0) {
u->setNick(i->substr(2));
} else if(i->compare(0, 2, "HU") == 0) {
hub = u;
} else if(i->compare(0, 2, "DE") == 0) {
u->setDescription(i->substr(2));
} else if(i->compare(0, 2, "I4") == 0) {
u->setIp(i->substr(2));
} else if(i->compare(0, 2, "SS") == 0) {
u->setBytesShared(i->substr(2));
} else if(i->compare(0, 2, "VE") == 0) {
ve = i->substr(2);
} else if(i->compare(0, 2, "EM") == 0) {
u->setEmail(i->substr(2));
} else if(i->compare(0, 2, "OP") == 0) {
if(i->length() == 2) {
u->unsetFlag(User::OP);
} else {
u->setFlag(User::OP);
}
} else if(i->compare(0, 2, "HO") == 0) {
op = Util::toInt(i->substr(2));
} else if(i->compare(0, 2, "HR") == 0) {
reg = Util::toInt(i->substr(2));
} else if(i->compare(0, 2, "HN") == 0) {
norm = Util::toInt(i->substr(2));
} else if(i->compare(0, 2, "SL") == 0) {
sl = Util::toInt(i->substr(2));
} else if(i->compare(0, 2, "BO") == 0) {
if(i->length() == 2) {
u->unsetFlag(User::BOT);
} else {
u->setFlag(User::BOT);
}
} else if(i->compare(0, 2, "HI") == 0) {
if(i->length() == 2) {
u->unsetFlag(User::HIDDEN);
} else {
u->setFlag(User::HIDDEN);
}
} else if(i->compare(0, 2, "HU") == 0) {
if(i->length() == 2) {
u->unsetFlag(User::HUB);
} else {
u->setFlag(User::HUB);
}
}
}
if(!ve.empty()) {
if(ve.find(' ') != string::npos) {
ve.insert(ve.find(' ') + 1, "V:");
}
u->setTag("<" + ve + ",M:" + string(u->getIp().empty() ? "P" : "A") + ",H:" + Util::toString(norm) + "/" +
Util::toString(reg) + "/" + Util::toString(op) + ",S:" +
Util::toString(sl) + ">" );
}
if(u == getMe())
state = STATE_NORMAL;
fire(ClientListener::UserUpdated(), this, u);
}