diff options
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/rlvdefines.h | 1 | ||||
| -rw-r--r-- | indra/newview/rlvhandler.cpp | 25 | ||||
| -rw-r--r-- | indra/newview/rlvhelper.cpp | 1 | 
3 files changed, 27 insertions, 0 deletions
| diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index c6ba135f3e..5161e9241c 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -98,6 +98,7 @@ namespace Rlv          SitGround,          Unsit,          Detach, +        GetInv,          GetCommand,          Count, diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 67739ec72f..57275af54a 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -28,6 +28,8 @@  #include "llviewerprecompiledheaders.h"  #include "llagent.h"  #include "llstartup.h" +#include "llappearancemgr.h" +#include "llinventorymodel.h"  #include "llmoveview.h"  #include "llviewercontrol.h"  #include "llviewermenu.h" @@ -238,6 +240,29 @@ ECmdRet ReplyHandler<EBehaviour::GetSitID>::onCommand(const RlvCommand& rlvCmd,      return ECmdRet::Succeeded;  } +template<> template<> +ECmdRet ReplyHandler<EBehaviour::GetInv>::onCommand(const RlvCommand& rlvCmd, std::string& strReply) +{ +    LLInventoryModel::cat_array_t* cats; +    LLInventoryModel::item_array_t* items; +    auto rlvFolderID = findDescendentCategoryIDByName(gInventory.getRootFolderID(), "#RLV"); +    if (rlvFolderID == LLUUID::null) +        return ECmdRet::FailedNoSharedRoot; +    strReply = ""; +    gInventory.getDirectDescendentsOf(rlvFolderID, cats, items); +    auto iter = cats->begin(); +    for(; cats->end() != iter; ++iter) +    { +        auto name = (*iter)->getName(); +        if (name.front() == '.') +            continue; +        if (iter != cats->begin()) +            strReply.append(","); +        strReply.append(name); +    } +    return ECmdRet::Succeeded; +} +  // Force  ECmdRet CommandHandlerBaseImpl<EParamType::Force>::processCommand(const RlvCommand& rlvCmd, ForceHandlerFunc* pHandler) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index b4abbc04f3..9f71d81206 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -51,6 +51,7 @@ BehaviourDictionary::BehaviourDictionary()      //      addEntry(new ReplyProcessor<EBehaviour::GetCommand>("getcommand"));      addEntry(new ReplyProcessor<EBehaviour::GetSitID>("getsitid")); +    addEntry(new ReplyProcessor<EBehaviour::GetInv>("getinv"));      addEntry(new ReplyProcessor<EBehaviour::Version, VersionReplyHandler>("version"));      addEntry(new ReplyProcessor<EBehaviour::VersionNew, VersionReplyHandler>("versionnew"));      addEntry(new ReplyProcessor<EBehaviour::VersionNum>("versionnum")); | 
