]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: Added new commands: VERSION SERVER, VERSION FLASH, VERSION TEMPLATEHOST.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 28 Feb 2011 19:55:47 +0000 (19:55 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 28 Feb 2011 19:55:47 +0000 (19:55 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@500 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

common/log/log.cpp
core/producer/flash/cg_producer.cpp
core/producer/flash/cg_producer.h
protocol/amcp/AMCPCommandsImpl.cpp
protocol/util/ClientInfo.h
shell/main.cpp

index 0ac0278c16a1a53cc83311d2f8bda7024259a7cb..ca1c380774caba506ea6903ed2d0fd7883c9bf2b 100644 (file)
@@ -101,10 +101,10 @@ void add_file_sink(const std::wstring& folder)
                );\r
 \r
                file_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= info);\r
-\r
-               std::wcout << L"Logging [info] or higher severity to " << folder << std::endl << std::endl;\r
-\r
+               \r
                boost::log::wcore::get()->add_sink(file_sink);\r
+\r
+               CASPAR_LOG(info) << L"Logging [info] or higher severity to " << folder << std::endl << std::endl;\r
        }\r
        catch(...)\r
        {\r
index 95db82b42d3b55b525865b010ba4b3985aa95d6c..1b53c4c161cf81b4cb995e956492ace376876efc 100644 (file)
@@ -135,4 +135,8 @@ void cg_producer::invoke(int layer, const std::wstring& label){impl_->invoke(lay
 void cg_producer::initialize(const safe_ptr<frame_factory>& frame_factory){impl_->initialize(frame_factory);}\r
 void cg_producer::set_parent_printer(const printer& parent_printer) { impl_->set_parent_printer(parent_printer);}\r
 std::wstring cg_producer::print() const{return impl_->print();}\r
+std::wstring cg_producer::version() \r
+{\r
+       return L"Unknown";\r
+}\r
 }}}
\ No newline at end of file
index 88dcd67167acf236a95ea664b7088ff2cecb654d..60b285b56441e2daba83914d989d3feb771cd588 100644 (file)
@@ -30,6 +30,8 @@ public:
        \r
        virtual std::wstring print() const;\r
 \r
+       static std::wstring version();\r
+\r
 private:\r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
index c804712a4f952672f63d8c7600b46661774d8b77..0323df8df54684ad49f8391d3cb95d0ab706585a 100644 (file)
@@ -1009,10 +1009,19 @@ bool TlsCommand::DoExecute()
 \r
 bool VersionCommand::DoExecute()\r
 {\r
-       std::wstringstream replyString;\r
-       replyString << TEXT("201 VERSION OK\r\n") << env::version() << TEXT("\r\n");\r
+       std::wstring replyString = TEXT("201 VERSION OK\r\n SERVER: ") + env::version() + TEXT("\r\n");\r
 \r
-       SetReplyString(replyString.str());\r
+       if(_parameters.size() > 0)\r
+       {\r
+               if(_parameters[0] == L"FLASH")\r
+                       replyString = TEXT("201 VERSION OK\r\n FLASH: ") + flash::flash_producer::version() + TEXT("\r\n");\r
+               else if(_parameters[0] == L"TEMPLATEHOST")\r
+                       replyString = TEXT("201 VERSION OK\r\n TEMPLATEHOST: ") + flash::cg_producer::version() + TEXT("\r\n");\r
+               else if(_parameters[0] != L"SERVER")\r
+                       replyString = TEXT("403 VERSION ERROR\r\n");\r
+       }\r
+\r
+       SetReplyString(replyString);\r
        return true;\r
 }\r
 \r
index 012050e43646a2d842f49a46fc4385118359133d..b6da5d3d03a08c7894cbfca7d77dca02d9fa0afa 100644 (file)
@@ -21,6 +21,7 @@
 \r
 #include <memory>\r
 #include <string>\r
+#include <iostream>\r
 \r
 namespace caspar { namespace IO {\r
 \r
@@ -39,9 +40,12 @@ public:
 };\r
 typedef std::shared_ptr<ClientInfo> ClientInfoPtr;\r
 \r
-struct DummyClientInfo : public caspar::IO::ClientInfo \r
+struct ConsoleClientInfo : public caspar::IO::ClientInfo \r
 {\r
-       void Send(const std::wstring& /*data*/){}\r
+       void Send(const std::wstring& data)\r
+       {\r
+               std::wcout << data << std::endl;\r
+       }\r
        void Disconnect(){}\r
 };\r
 \r
index 047bc895033adec2486f0676748bbf988fc5d3a7..89a4a5b29176d97e68fac05ad78f4234b3ea2331 100644 (file)
@@ -34,6 +34,7 @@
 #include "bootstrapper.h"\r
 \r
 #include <core/producer/flash/flash_producer.h>\r
+#include <core/producer/flash/cg_producer.h>\r
 \r
 #include <common/exception/win32_exception.h>\r
 #include <common/exception/exceptions.h>\r
@@ -98,9 +99,6 @@ void setup_console_window()
        std::wstringstream str;\r
        str << "CasparCG Server " << env::version() << L"      Flash " << flash::flash_producer::version();\r
        SetConsoleTitle(str.str().c_str());\r
-\r
-       std::wcout << L"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n" << std::endl;\r
-       std::wcout << L"Starting CasparCG Video Playout Server Ver: " << env::version() << std::endl;\r
 }\r
  \r
 int main(int argc, wchar_t* argv[])\r
@@ -132,11 +130,17 @@ int main(int argc, wchar_t* argv[])
                MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
        #endif\r
 \r
+               CASPAR_LOG(info) << L"Copyright (c) 2010 Sveriges Television AB, www.casparcg.com, <info@casparcg.com>";\r
+               CASPAR_LOG(info) << L"Starting CasparCG Video Playout Server.";\r
+               CASPAR_LOG(info) << L"Server Version: " << env::version();\r
+               CASPAR_LOG(info) << L"Flash Version: " << flash::flash_producer::version();\r
+               CASPAR_LOG(info) << L"Template-Host Version: " << flash::cg_producer::version();\r
+                        \r
                log::add_file_sink(env::log_folder());\r
                                \r
                bootstrapper caspar_device;\r
                                \r
-               auto dummy = std::make_shared<IO::DummyClientInfo>();\r
+               auto dummy = std::make_shared<IO::ConsoleClientInfo>();\r
                amcp::AMCPProtocolStrategy amcp(caspar_device.get_channels());\r
                bool is_running = true;\r
                while(is_running)\r