Index: src/client/c/hu/varadiistvan/xplra/XPlane.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 30)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 36)
@@ -193,4 +193,20 @@
 //------------------------------------------------------------------------------
 
+void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion)
+    throw(Exception)
+{
+    stream->writeU8(Protocol::COMMAND_GET_VERSIONS);
+    stream->flush();
+    checkResult();
+
+    xplaneVersion = stream->readS32();
+    xplmVersion = stream->readS32();
+    xplraVersion = stream->readS32();
+
+    checkStream();
+}
+
+//------------------------------------------------------------------------------
+
 void XPlane::getScalar(const char* name, uint8_t type) throw(Exception)
 {
Index: src/client/c/hu/varadiistvan/xplra/XPlane.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 30)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 36)
@@ -145,4 +145,9 @@
 
     /**
+     * Get the versions of X-Plane, XPLM and the XPLRA plugin.
+     */
+    void getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) throw(Exception);
+
+    /**
      * Get the integer value of the dataref with the given name.
      */
Index: src/client/c/hu/varadiistvan/xplra/xplra.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 29)
+++ src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 36)
@@ -498,4 +498,21 @@
 //------------------------------------------------------------------------------
 
+extern "C"int xplra_get_versions(int connectionID,
+                                 int* xplaneVersion, int* xplmVersion,
+                                 int* xplraVersion)
+{
+    Connection* connection = ConnectionSlot::getValue(connectionID);
+    if (connection==0) return -1;
+    try {
+        connection->getVersions(*xplaneVersion, *xplmVersion, *xplraVersion);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
 extern "C" int xplra_get_int(int* value, int connectionID, const char* name)
 {
Index: src/client/c/hu/varadiistvan/xplra/xplra.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 29)
+++ src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 36)
@@ -130,4 +130,13 @@
 
 /*----------------------------------------------------------------------------*/
+
+/**
+ * Get the versions of X-Plane, the XPLM library and XPLRA
+ */
+int xplra_get_versions(int connectionID,
+                       int* xplaneVersion, int* xplmVersion,
+                       int* xplraVersion);
+
+/*----------------------------------------------------------------------------*/
 /* Single dataref support                                                     */
 /*----------------------------------------------------------------------------*/
Index: src/client/python/xplra.py
===================================================================
--- src/client/python/xplra.py	(revision 35)
+++ src/client/python/xplra.py	(revision 36)
@@ -27,4 +27,6 @@
 
 COMMAND_EXECUTE_SET_MULTI = 0x23
+
+COMMAND_GET_VERSIONS = 0x31
 
 TYPE_INT = 0x01
@@ -135,4 +137,11 @@
         """Create a new multi-dataref setter for this X-Plane object."""
         return MultiSetter(self)
+
+    def getVersions(self):
+        """Get the versions of X-Plane, XPLM and XPLRA as a tuple."""
+        self._writeU8(COMMAND_GET_VERSIONS)
+        self._flush()
+        self._checkResult()
+        return (self._readS32(), self._readS32(), self._readS32())
 
     def getInt(self, name):
@@ -392,4 +401,11 @@
 
         self._registeredID = None
+
+    @property
+    def values(self):
+        """Query the values as a list."""
+        if self._values is None:
+            self.finalize()
+        return self._values
 
     def addInt(self, name):
Index: src/plugin/src/xplra/ListenThread.cc
===================================================================
--- src/plugin/src/xplra/ListenThread.cc	(revision 13)
+++ src/plugin/src/xplra/ListenThread.cc	(revision 36)
@@ -55,5 +55,6 @@
     while(!quitEvent.check() && !quitEvent.failed() && !acceptor.failed()) {
         if (acceptor.accept()) {
-            ServerThread* serverThread = new ServerThread(requestQueue,
+            ServerThread* serverThread = new ServerThread(*this,
+                                                          requestQueue,
                                                           acceptor);
             serverThread->start();
Index: src/plugin/src/xplra/ListenThread.h
===================================================================
--- src/plugin/src/xplra/ListenThread.h	(revision 13)
+++ src/plugin/src/xplra/ListenThread.h	(revision 36)
@@ -54,4 +54,14 @@
 private:
     /**
+     * The version of X-Plane.
+     */
+    int xplaneVersion;
+
+    /**
+     * The version of the XPLM library.
+     */
+    int xplmVersion;
+
+    /**
      * The waiter used in the thread.
      */
@@ -73,5 +83,10 @@
      * Construct the thread.
      */
-    ListenThread();
+    ListenThread(int xplaneVersion, int xplmVersion);
+
+    /**
+     * Get the versions
+     */
+    void getVersions(int& xplane, int& xplm) const;
 
     /**
@@ -90,8 +105,18 @@
 //------------------------------------------------------------------------------
 
-inline ListenThread::ListenThread() :
+inline ListenThread::ListenThread(int xplaneVersion, int xplmVersion) :
     Thread(true),
+    xplaneVersion(xplaneVersion),
+    xplmVersion(xplmVersion),
     quitEvent(&waiter)
 {
+}
+
+//------------------------------------------------------------------------------
+
+inline void ListenThread::getVersions(int& xplane, int& xplm) const
+{
+    xplane = xplaneVersion;
+    xplm = xplmVersion;
 }
 
Index: src/plugin/src/xplra/Protocol.h
===================================================================
--- src/plugin/src/xplra/Protocol.h	(revision 13)
+++ src/plugin/src/xplra/Protocol.h	(revision 36)
@@ -92,4 +92,9 @@
 
     /**
+     * Command: get the versions of the simulator
+     */
+    static const uint8_t COMMAND_GET_VERSIONS = 0x31;
+
+    /**
      * Data type: int
      */
@@ -176,4 +181,9 @@
      */
     static const size_t MAX_MULTI_COUNT = 1024;
+
+    /**
+     * The version of the plugin.
+     */
+    static const int version = 10;
 };
 
Index: src/plugin/src/xplra/ServerThread.cc
===================================================================
--- src/plugin/src/xplra/ServerThread.cc	(revision 13)
+++ src/plugin/src/xplra/ServerThread.cc	(revision 36)
@@ -31,4 +31,5 @@
 #include "ServerThread.h"
 
+#include "ListenThread.h"
 #include "RequestQueue.h"
 #include "Protocol.h"
@@ -72,6 +73,8 @@
 //------------------------------------------------------------------------------
 
-ServerThread::ServerThread(RequestQueue& requestQueue, LocalAcceptor& acceptor) :
+ServerThread::ServerThread(ListenThread& listenThread,
+                           RequestQueue& requestQueue, LocalAcceptor& acceptor) :
     Thread(true),
+    listenThread(listenThread),
     requestQueue(requestQueue),
     bufferedStream(acceptor.getSocket(&waiter)),
@@ -147,4 +150,6 @@
         } else if (command==Protocol::COMMAND_EXECUTE_SET_MULTI) {
             if (!handleExecuteSetMulti()) break;
+        } else if (command==Protocol::COMMAND_GET_VERSIONS) {
+            if (!handleGetVersions()) break;
         } else {
             stream.writeU8(Protocol::RESULT_INVALID_COMMAND);
@@ -384,4 +389,21 @@
 //------------------------------------------------------------------------------
 
+bool ServerThread::handleGetVersions()
+{
+    int xplaneVersion = 0;
+    int xplmVersion = 0;
+
+    listenThread.getVersions(xplaneVersion, xplmVersion);
+
+    stream.writeU8(Protocol::RESULT_OK);
+    stream.writeS32(xplaneVersion);
+    stream.writeS32(xplmVersion);
+    stream.writeS32(Protocol::version);
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
 // Local Variables:
 // mode: C++
Index: src/plugin/src/xplra/ServerThread.h
===================================================================
--- src/plugin/src/xplra/ServerThread.h	(revision 13)
+++ src/plugin/src/xplra/ServerThread.h	(revision 36)
@@ -49,4 +49,6 @@
 //------------------------------------------------------------------------------
 
+class ListenThread;
+
 class RequestQueue;
 
@@ -95,4 +97,9 @@
 private:
     /**
+     * The listen thread this server was started by.
+     */
+    ListenThread& listenThread;
+
+    /**
      * The request queue to use.
      */
@@ -139,5 +146,5 @@
      * given acceptor.
      */
-    ServerThread(RequestQueue& requestQueue,
+    ServerThread(ListenThread& listenThread, RequestQueue& requestQueue,
                  hu::varadiistvan::scpl::io::LocalAcceptor& acceptor);
 
@@ -227,4 +234,11 @@
      */
     bool handleExecuteSetMulti();
+
+    /**
+     * Handle the COMMAND_GET_VERSIONS command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleGetVersions();
 };
 
Index: src/plugin/src/xplra/plugin.cc
===================================================================
--- src/plugin/src/xplra/plugin.cc	(revision 13)
+++ src/plugin/src/xplra/plugin.cc	(revision 36)
@@ -83,5 +83,11 @@
     Util::debug("hu.varadiistvan.xplra.XPluginEnable called\n");
     // XPLMRegisterFlightLoopCallback(&callback, 5.0, 0);
-    listenThread = new ListenThread();
+
+    int xplaneVersion = 0;
+    int xplmVersion = 0;
+    XPLMHostApplicationID hostID = 0;
+    XPLMGetVersions(&xplaneVersion, &xplmVersion, &hostID);
+
+    listenThread = new ListenThread(xplaneVersion, xplmVersion);
     listenThread->start();
 }
Index: test/basicctest.c
===================================================================
--- test/basicctest.c	(revision 29)
+++ test/basicctest.c	(revision 36)
@@ -42,4 +42,9 @@
     int retval = 0;
     const char* errorString = 0;
+
+    int xplaneVersion = 0;
+    int xplmVersion = 0;
+    int xplraVersion = 0;
+
     int numEngines = 0;
     float spoolTime = 0.0;
@@ -69,4 +74,10 @@
     }
 
+    printf("Querying the versions...\n");
+    if (xplra_get_versions(connectionID, &xplaneVersion,
+                           &xplmVersion, &xplraVersion)<0) goto error;
+    printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
+           xplaneVersion, xplmVersion, xplraVersion);
+
     printf("Querying the number of the engines...\n");
     if (xplra_get_int(&numEngines, connectionID,
Index: test/basictest.cc
===================================================================
--- test/basictest.cc	(revision 25)
+++ test/basictest.cc	(revision 36)
@@ -53,4 +53,13 @@
         printf("Connected to X-Plane.\n\n");
 
+        int xplaneVersion = 0;
+        int xplmVersion = 0;
+        int xplraVersion = 0;
+
+        printf("Querying the versions...\n");
+        xplane.getVersions(xplaneVersion, xplmVersion, xplraVersion);
+        printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
+               xplaneVersion, xplmVersion, xplraVersion);
+
         printf("Querying the number of the engines...\n");
         int numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
Index: test/basictest.py
===================================================================
--- test/basictest.py	(revision 35)
+++ test/basictest.py	(revision 36)
@@ -12,4 +12,10 @@
         xplane.connect()
         print "Connected to X-Plane."
+        print
+
+        print "Querying the versions..."
+        (xplaneVersion, xplmVersion, xplraVersion) = xplane.getVersions()
+        print "X-Plane version: %d, XPLM: %d, XPLRA: %03d" % \
+               (xplaneVersion, xplmVersion, xplraVersion)
         print
 
