summaryrefslogtreecommitdiff
path: root/indra/newview/rlvhandler.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-03 21:21:58 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-03 21:21:58 +0800
commitd32b1c090f396824c5ec2ffbc40b174a55bdbe0b (patch)
treebdf6f1753b8ec7b37aa0831e6ff0beeffcefd869 /indra/newview/rlvhandler.cpp
parentb024b356c75528b4d2688016d49a11e1270fb48d (diff)
parent2283c5c35103dd99b35ca43a09bf8e11e6cd7957 (diff)
Merge branch 'main' into gltf_mesh_import
Diffstat (limited to 'indra/newview/rlvhandler.cpp')
-rw-r--r--indra/newview/rlvhandler.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 6c4b439105..67739ec72f 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -28,8 +28,11 @@
#include "llviewerprecompiledheaders.h"
#include "llagent.h"
#include "llstartup.h"
+#include "llmoveview.h"
#include "llviewercontrol.h"
+#include "llviewermenu.h"
#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
#include "rlvcommon.h"
#include "rlvhandler.h"
@@ -109,6 +112,9 @@ ECmdRet RlvHandler::processCommand(std::reference_wrapper<const RlvCommand> rlvC
switch (rlvCmd.get().getParamType())
{
case EParamType::Reply:
+ case EParamType::Force:
+ case EParamType::Remove:
+ case EParamType::Add:
eRet = rlvCmd.get().processCommand();
break;
case EParamType::Unknown:
@@ -222,4 +228,78 @@ ECmdRet ReplyHandler<EBehaviour::VersionNum>::onCommand(const RlvCommand& rlvCmd
return ECmdRet::Succeeded;
}
+template<> template<>
+ECmdRet ReplyHandler<EBehaviour::GetSitID>::onCommand(const RlvCommand& rlvCmd, std::string& strReply)
+{
+ if (gAgent.isSitting())
+ gAgent.getSitObjectID().toString(strReply);
+ else
+ strReply = "00000000-0000-0000-0000-000000000000";
+ return ECmdRet::Succeeded;
+}
+
+// Force
+
+ECmdRet CommandHandlerBaseImpl<EParamType::Force>::processCommand(const RlvCommand& rlvCmd, ForceHandlerFunc* pHandler)
+{
+ return (*pHandler)(rlvCmd);
+}
+
+template<> template<>
+ECmdRet ForceHandler<EBehaviour::Sit>::onCommand(const RlvCommand& rlvCmd)
+{
+ handle_object_sit(LLUUID{rlvCmd.getOption()});
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
+ECmdRet ForceHandler<EBehaviour::SitGround>::onCommand(const RlvCommand& rlvCmd)
+{
+ gAgent.sitDown();
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
+ECmdRet ForceHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd)
+{
+ gAgent.standUp();
+ return ECmdRet::Succeeded;
+}
+
+// AddRem
+
+ECmdRet CommandHandlerBaseImpl<EParamType::AddRem>::processCommand(const RlvCommand& rlvCmd, BhvrHandlerFunc* pHandler, BhvrToggleHandlerFunc* pToggleHandler)
+{
+ auto param = rlvCmd.getParam();
+ bool toggle = false;
+ if (param == "y")
+ toggle = true;
+ else if (param != "n")
+ return ECmdRet::FailedParam;
+ return (*pHandler)(rlvCmd, toggle);
+}
+
+template<> template<>
+ECmdRet BehaviourToggleHandler<EBehaviour::Sit>::onCommand(const RlvCommand& rlvCmd, bool& toggle)
+{
+ gAgent.setAllowedToSit(toggle);
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
+ECmdRet BehaviourToggleHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd, bool& toggle)
+{
+ gAgent.setAllowedToStand(toggle);
+ if (gAgent.isSitting())
+ LLPanelStandStopFlying::getInstance()->setVisibleStandButton(toggle);
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
+ECmdRet BehaviourToggleHandler<EBehaviour::Detach>::onCommand(const RlvCommand& rlvCmd, bool& toggle)
+{
+ gObjectList.findObject(rlvCmd.getObjectID())->setLocked(!toggle);
+ return ECmdRet::Succeeded;
+}
+
// ============================================================================