本文整理汇总了C++中CommandContainer::moderator_command_size方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandContainer::moderator_command_size方法的具体用法?C++ CommandContainer::moderator_command_size怎么用?C++ CommandContainer::moderator_command_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandContainer
的用法示例。
在下文中一共展示了CommandContainer::moderator_command_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processCommandContainer
void Server_ProtocolHandler::processCommandContainer(const CommandContainer &cont)
{
// Command processing must be disabled after prepareDestroy() has been called.
if (deleted)
return;
lastDataReceived = timeRunning;
ResponseContainer responseContainer(cont.has_cmd_id() ? cont.cmd_id() : -1);
Response::ResponseCode finalResponseCode;
if (cont.game_command_size())
finalResponseCode = processGameCommandContainer(cont, responseContainer);
else if (cont.room_command_size())
finalResponseCode = processRoomCommandContainer(cont, responseContainer);
else if (cont.session_command_size())
finalResponseCode = processSessionCommandContainer(cont, responseContainer);
else if (cont.moderator_command_size())
finalResponseCode = processModeratorCommandContainer(cont, responseContainer);
else if (cont.admin_command_size())
finalResponseCode = processAdminCommandContainer(cont, responseContainer);
else
finalResponseCode = Response::RespInvalidCommand;
if ((finalResponseCode != Response::RespNothing))
sendResponseContainer(responseContainer, finalResponseCode);
}
示例2: processModeratorCommandContainer
Response::ResponseCode Server_ProtocolHandler::processModeratorCommandContainer(const CommandContainer &cont, ResponseContainer &rc)
{
if (!userInfo)
return Response::RespLoginNeeded;
if (!(userInfo->user_level() & ServerInfo_User::IsModerator))
return Response::RespLoginNeeded;
Response::ResponseCode finalResponseCode = Response::RespOk;
for (int i = cont.moderator_command_size() - 1; i >= 0; --i) {
Response::ResponseCode resp = Response::RespInvalidCommand;
const ModeratorCommand &sc = cont.moderator_command(i);
const int num = getPbExtension(sc);
logDebugMessage(QString::fromStdString(sc.ShortDebugString()));
resp = processExtendedModeratorCommand(num, sc, rc);
if (resp != Response::RespOk)
finalResponseCode = resp;
}
return finalResponseCode;
}