]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPCommand.h
[AMCP] #475 Added special command REQ that can be prepended before any command to...
[casparcg] / protocol / amcp / AMCPCommand.h
index 0eb9a2855bff2297c9d4629aa4e09e1b6c858744..7c6d56af797a3468746c928a1515177e95d23c2b 100644 (file)
@@ -95,6 +95,7 @@ namespace amcp {
                int                                     min_num_params_;
                std::wstring            name_;
                std::wstring            replyString_;
+               std::wstring            request_id_;
        public:
                AMCPCommand(const command_context& ctx, const amcp_command_func& command, int min_num_params, const std::wstring& name)
                        : ctx_(ctx)
@@ -134,9 +135,17 @@ namespace amcp {
                        return name_;
                }
 
+               void set_request_id(std::wstring request_id)
+               {
+                       request_id_ = std::move(request_id);
+               }
+
                void SetReplyString(const std::wstring& str)
                {
-                       replyString_ = str;
+                       if (request_id_.empty())
+                               replyString_ = str;
+                       else
+                               replyString_ = L"RES " + request_id_ + L" " + str;
                }
        };
 }}}