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();
 }
