Index: src/plugin/src/xplra/Makefile.am
===================================================================
--- src/plugin/src/xplra/Makefile.am	(revision 75)
+++ src/plugin/src/xplra/Makefile.am	(revision 81)
@@ -18,4 +18,5 @@
 	SetMultiDataRefRequest.cc	\
 	ReloadPluginsRequest.cc		\
+	SaveSituationRequest.cc		\
 	Globals.cc			\
 	MessageWindow.cc		\
@@ -39,4 +40,5 @@
 	SetMultiDataRefRequest.h	\
 	ReloadPluginsRequest.h		\
+	SaveSituationRequest.h		\
 	Globals.h			\
 	MessageWindow.h			\
Index: src/plugin/src/xplra/Protocol.h
===================================================================
--- src/plugin/src/xplra/Protocol.h	(revision 45)
+++ src/plugin/src/xplra/Protocol.h	(revision 81)
@@ -102,4 +102,12 @@
 
     /**
+     * Command: save the current situation.
+     *
+     * Followed by a string containing the path of the file to save
+     * relative to the X-System directory.
+     */
+    static const uint8_t COMMAND_SAVE_SITUATION = 0x33;
+
+    /**
      * Command: show a message in the message window.
      */
Index: src/plugin/src/xplra/SaveSituationRequest.cc
===================================================================
--- src/plugin/src/xplra/SaveSituationRequest.cc	(revision 81)
+++ src/plugin/src/xplra/SaveSituationRequest.cc	(revision 81)
@@ -0,0 +1,61 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "SaveSituationRequest.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+#include <XPLMUtilities.h>
+
+//------------------------------------------------------------------------------
+
+using xplra::SaveSituationRequest;
+
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+void SaveSituationRequest::execute()
+{
+    int result = XPLMSaveDataFile(xplm_DataFile_Situation,
+                                  path.c_str());
+    success = result==1;
+    if (!success) {
+        Util::debug("xplra::SaveSituationRequest::execute: result=%d\n", result);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/SaveSituationRequest.h
===================================================================
--- src/plugin/src/xplra/SaveSituationRequest.h	(revision 81)
+++ src/plugin/src/xplra/SaveSituationRequest.h	(revision 81)
@@ -0,0 +1,105 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_SAVESITUATIONREQUEST_H
+#define XPLRA_SAVESITUATIONREQUEST_H
+//------------------------------------------------------------------------------
+
+#include "Request.h"
+
+#include <string>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A request that saves the current situation into a file.
+ */
+class SaveSituationRequest : public Request
+{
+private:
+    /**
+     * The path to save the situation into.
+     */
+    std::string path;
+
+    /**
+     * Indicate the success.
+     */
+    bool success;
+
+public:
+    /**
+     * Construct the request.
+     */
+    SaveSituationRequest(const std::string& path);
+
+    /**
+     * Get the result.
+     */
+    bool getSuccess() const;
+
+protected:
+    /**
+     * Execute the request.
+     */
+    virtual void execute();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline SaveSituationRequest::SaveSituationRequest(const std::string& path) :
+    path(path),
+    success(false)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline bool SaveSituationRequest::getSuccess() const
+{
+    return success;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_SAVESITUATIONREQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/ServerThread.cc
===================================================================
--- src/plugin/src/xplra/ServerThread.cc	(revision 46)
+++ src/plugin/src/xplra/ServerThread.cc	(revision 81)
@@ -40,4 +40,7 @@
 #include "SetMultiDataRefRequest.h"
 #include "ReloadPluginsRequest.h"
+#ifdef XPLM200
+#include "SaveSituationRequest.h"
+#endif
 #include "MessageRequest.h"
 #include "Globals.h"
@@ -170,4 +173,8 @@
         } else if (command==Protocol::COMMAND_RELOAD_PLUGINS) {
             if (!handleReloadPlugins()) break;
+#ifdef XPLM200
+        } else if (command==Protocol::COMMAND_SAVE_SITUATION) {
+            if (!handleSaveSituation()) break;
+#endif
         } else if (command==Protocol::COMMAND_SHOW_MESSAGE) {
             if (!handleShowMessage()) break;
@@ -446,4 +453,22 @@
 //------------------------------------------------------------------------------
 
+#ifdef XPLM200
+
+bool ServerThread::handleSaveSituation()
+{
+    string path = stream.readString();
+    SaveSituationRequest request(path);
+    if (!requestQueue.execute(&request)) return false;
+
+    stream.writeU8(request.getSuccess() ? Protocol::RESULT_OK :
+                   Protocol::RESULT_OTHER_ERROR);
+
+    return true;
+}
+
+#endif
+
+//------------------------------------------------------------------------------
+
 bool ServerThread::handleShowMessage()
 {
Index: src/plugin/src/xplra/ServerThread.h
===================================================================
--- src/plugin/src/xplra/ServerThread.h	(revision 45)
+++ src/plugin/src/xplra/ServerThread.h	(revision 81)
@@ -256,4 +256,13 @@
     bool handleReloadPlugins();
 
+#ifdef XPLM200
+    /**
+     * Handle the COMMAND_SAVE_SITUATION command.
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleSaveSituation();
+#endif
+
     /**
      * Handle the COMMAND_SHOW_MESSAGE command
