X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=protocol%2Famcp%2FAMCPCommandsImpl.cpp;h=75f8e3f9ddfa90b6f17c8f544f87bc38d4ec4b88;hb=4ac65fc10ec085fbbb9047df5b5027bfb730b925;hp=81ea2ef344b3b989493d322b3f96d58209e1fba4;hpb=3772f3b4f92553575a8ea1ba02e3b706ac0004bc;p=casparcg diff --git a/protocol/amcp/AMCPCommandsImpl.cpp b/protocol/amcp/AMCPCommandsImpl.cpp index 81ea2ef34..75f8e3f9d 100644 --- a/protocol/amcp/AMCPCommandsImpl.cpp +++ b/protocol/amcp/AMCPCommandsImpl.cpp @@ -1363,13 +1363,26 @@ bool InfoCommand::DoExecute() boost::property_tree::write_xml(replyString, info, w); } - else // channel + else if(_parameters.size() >= 1 && _parameters[0] == L"SERVER") { - replyString << TEXT("201 INFO OK\r\n"); + replyString << L"201 INFO SYSTEM OK\r\n"; boost::property_tree::wptree info; + + int index = 0; + BOOST_FOREACH(auto channel, channels_) + info.add_child(L"channels.channel", channel->info()) + .add(L"index", ++index); + + boost::property_tree::write_xml(replyString, info, w); + } + else // channel + { if(_parameters.size() >= 1) { + replyString << TEXT("201 INFO OK\r\n"); + boost::property_tree::wptree info; + std::vector split; boost::split(split, _parameters[0], boost::is_any_of("-")); @@ -1399,16 +1412,17 @@ bool InfoCommand::DoExecute() .add(L"index", layer); } } + boost::property_tree::xml_parser::write_xml(replyString, info, w); } else { - int index = 0; - BOOST_FOREACH(auto channel, channels_) - info.add_child(L"channels.channel", channel->info()) - .add(L"index", ++index); + // This is needed for backwards compatibility with old clients + replyString << TEXT("200 INFO OK\r\n"); + for(size_t n = 0; n < channels_.size(); ++n) + GenerateChannelInfo(n, channels_[n], replyString); + replyString << TEXT("\r\n"); } - boost::property_tree::xml_parser::write_xml(replyString, info, w); } } catch(...)