diff options
| author | Rider Linden <rider@lindenlab.com> | 2026-08-06 14:25:45 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2026-08-06 14:25:45 -0700 |
| commit | 309fc5b4c21151e3664f5bdab99f57bae24266a0 (patch) | |
| tree | d7700857c86f8945d805b848494102cee299ac50 /indra/newview/llscripteditorws.h | |
| parent | ebf9cd31d789c0556d741987e95a961edd2955d0 (diff) | |
JSON-RPC command.execute instruction for arbitrary 1-off commands and extensions.
Diffstat (limited to 'indra/newview/llscripteditorws.h')
| -rw-r--r-- | indra/newview/llscripteditorws.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llscripteditorws.h b/indra/newview/llscripteditorws.h index 475a8049ee..63b60335ff 100644 --- a/indra/newview/llscripteditorws.h +++ b/indra/newview/llscripteditorws.h @@ -39,6 +39,7 @@ #include <map> #include <set> #include <atomic> +#include <functional> // Forward declarations class LLLiveLSLEditor; @@ -87,6 +88,7 @@ public: void onClose() override; void sendDisconnect(DisconnectReason reason = DisconnectReason::NORMAL, const std::string& message = "Goodbye"); + bool hasFeature(const std::string& feature) const; private: using string_set_t = std::set<std::string>; @@ -205,6 +207,8 @@ public: bool publishObject(const LLUUID& object_id); void unpublishObject(const LLUUID& object_id, const std::string& reason = ""); bool isObjectPublished(const LLUUID& object_id) const; + + // *TODO*: These should be moved to LLPublishedObjectMgr at some point. void onPrimInventoryReady(const LLUUID& object_id, const LLUUID& prim_id); void onPrimInventoryChanged(const LLUUID& object_id, const LLUUID& prim_id); void onObjectPropertyChanged(const LLUUID& prim_id, const std::string& name, const std::string& desc, S16 inventory_serial = -1); @@ -242,6 +246,9 @@ protected: LLSD handleObjectScriptReset(U32 connection_id, const LLSD& params); LLSD handleObjectModify(U32 connection_id, const LLSD& params); LLSD handleObjectItemModify(U32 connection_id, const LLSD& params); + LLSD handleCommandExecute(U32 connection_id, const LLSD& params); + LLSD handleCommandList(); + void sendCommandExecute(U32 connection_id, const std::string& command, const LLSD& params); struct ValidatedItem { @@ -313,6 +320,23 @@ private: mutable LLPublishedObjectMgr mPublishedObjectManager; + struct WSCommandInfo + { + std::string command; + std::string description; + }; + enum WSCommandError + { + UnknownCommand = 1, + InvalidParams = 2, + NotPermitted = 3, + ExecutionError = 4, + }; + using WSCommandHandler = std::function<LLSD(U32 connection_id, const LLSD& params)>; + std::unordered_map<std::string, std::pair<WSCommandInfo, WSCommandHandler>> mCommandRegistry; + + void registerCommand(const WSCommandInfo& info, WSCommandHandler handler); + boost::signals2::connection mLanguageChangeSignal; LLUUID mLastSyntaxId; |
