From c820bb2929a37fb222ce0d7368d699e81f5edc00 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 31 Aug 2024 01:33:27 +0200 Subject: Minimal code needed to add RLVa with an on/off toggle --- indra/newview/rlvhandler.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 indra/newview/rlvhandler.h (limited to 'indra/newview/rlvhandler.h') diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h new file mode 100644 index 0000000000..0d4cbe98fb --- /dev/null +++ b/indra/newview/rlvhandler.h @@ -0,0 +1,25 @@ +#pragma once + +#include "llsingleton.h" + +#include "rlvdefines.h" + +// ============================================================================ +// RlvHandler class +// + +class RlvHandler : public LLSingleton +{ + LLSINGLETON_EMPTY_CTOR(RlvHandler); + +public: + // Initialization (deliberately static so they can safely be called in tight loops) + static bool canEnable(); + static bool isEnabled() { return mIsEnabled; } + static bool setEnabled(bool enable); + +private: + static bool mIsEnabled; +}; + +// ============================================================================ -- cgit v1.2.3 From b82e9b73d35e41ed51063905dd31ccced9e97266 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 1 Sep 2024 01:21:00 +0200 Subject: Add owner say chat hook --- indra/newview/rlvhandler.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/rlvhandler.h') diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 0d4cbe98fb..8cf054e98e 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -1,9 +1,12 @@ #pragma once +#include "llchat.h" #include "llsingleton.h" #include "rlvdefines.h" +class LLViewerObject; + // ============================================================================ // RlvHandler class // @@ -13,6 +16,14 @@ class RlvHandler : public LLSingleton LLSINGLETON_EMPTY_CTOR(RlvHandler); public: + /* + * Helper functions + */ +public: + // Command processing helper functions + bool handleSimulatorChat(std::string& message, const LLChat& chat, const LLViewerObject* chatObj); + Rlv::ECmdRet processCommand(const LLUUID& idObj, const std::string& stCmd, bool fromObj); + // Initialization (deliberately static so they can safely be called in tight loops) static bool canEnable(); static bool isEnabled() { return mIsEnabled; } -- cgit v1.2.3 From 7402fe6412e98e4b295ee3e04874f379c752f7a0 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 2 Sep 2024 01:39:17 +0200 Subject: Add basic scaffolding to support reply commands and handle @versionXXX as an illustration --- indra/newview/rlvhandler.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/rlvhandler.h') diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 8cf054e98e..a5e91548ef 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -3,7 +3,7 @@ #include "llchat.h" #include "llsingleton.h" -#include "rlvdefines.h" +#include "rlvhelper.h" class LLViewerObject; @@ -15,15 +15,17 @@ class RlvHandler : public LLSingleton { LLSINGLETON_EMPTY_CTOR(RlvHandler); -public: /* - * Helper functions + * Command processing */ public: // Command processing helper functions bool handleSimulatorChat(std::string& message, const LLChat& chat, const LLViewerObject* chatObj); Rlv::ECmdRet processCommand(const LLUUID& idObj, const std::string& stCmd, bool fromObj); +protected: + Rlv::ECmdRet processCommand(std::reference_wrapper rlvCmdRef, bool fromObj); +public: // Initialization (deliberately static so they can safely be called in tight loops) static bool canEnable(); static bool isEnabled() { return mIsEnabled; } -- cgit v1.2.3 From db8916454457e3e4856fddcbbafe66b3766e4ffa Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 3 Sep 2024 18:14:06 +0200 Subject: Add the RLVa console --- indra/newview/rlvhandler.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/rlvhandler.h') diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index a5e91548ef..7fa4da767a 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -13,6 +13,8 @@ class LLViewerObject; class RlvHandler : public LLSingleton { + template friend struct Rlv::CommandHandlerBaseImpl; + LLSINGLETON_EMPTY_CTOR(RlvHandler); /* @@ -25,12 +27,25 @@ public: protected: Rlv::ECmdRet processCommand(std::reference_wrapper rlvCmdRef, bool fromObj); + /* + * Helper functions + */ public: // Initialization (deliberately static so they can safely be called in tight loops) static bool canEnable(); static bool isEnabled() { return mIsEnabled; } static bool setEnabled(bool enable); + /* + * Event handling + */ +public: + // The command output signal is triggered whenever a command produces channel or debug output + using command_output_signal_t = boost::signals2::signal; + boost::signals2::connection setCommandOutputCallback(const command_output_signal_t::slot_type& cb) { return mOnCommandOutput.connect(cb); } + +protected: + command_output_signal_t mOnCommandOutput; private: static bool mIsEnabled; }; -- cgit v1.2.3 From 6f4d7c2d6d363aee60d2f3d1fe4ed4a251aaa11b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 17 Sep 2024 19:12:55 +0200 Subject: Add proper file headers --- indra/newview/rlvhandler.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/newview/rlvhandler.h') diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 7fa4da767a..38612485b1 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -1,3 +1,30 @@ +/** + * @file rlvhandler.h + * @author Kitty Barnett + * @brief Primary command process and orchestration class + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + #pragma once #include "llchat.h" -- cgit v1.2.3