Index: src/client/c/hu/varadiistvan/xplra/Exception.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/Exception.cc	(revision 14)
+++ src/client/c/hu/varadiistvan/xplra/Exception.cc	(revision 40)
@@ -61,6 +61,9 @@
 //------------------------------------------------------------------------------
 
-ProtocolException::ProtocolException(errorCode_t errorCode) throw() :
-    errorCode(errorCode)
+ProtocolException::ProtocolException(errorCode_t errorCode, bool hasParameter,
+                                     long parameter) throw() :
+    errorCode(errorCode),
+    hasParameter(parameter),
+    parameter(parameter)
 {
     switch (errorCode) {
@@ -70,4 +73,9 @@
       case UNKNOWN_DATAREF:
         message = "xplra::ProtocolException: unknown dataref";
+        if (hasParameter) {
+            char buf[32];
+            snprintf(buf, sizeof(buf), " (# %ld)", parameter);
+            message += buf;
+        }
         break;
       case INVALID_TYPE:
@@ -85,4 +93,7 @@
       case INVALID_ID:
         message = "xplra::ProtocolException: invalid ID";
+        break;
+      case INVALID_DURATION:
+        message = "xplra::ProtocolException: invalid duration";
         break;
       case OTHER:
Index: src/client/c/hu/varadiistvan/xplra/Exception.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/Exception.h	(revision 19)
+++ src/client/c/hu/varadiistvan/xplra/Exception.h	(revision 40)
@@ -143,4 +143,7 @@
         INVALID_ID = 7,
 
+        /// Invalid duration
+        INVALID_DURATION = 8,
+
         /// Other error
         OTHER = 255
@@ -153,9 +156,20 @@
     errorCode_t errorCode;
 
+    /**
+     * Indicate if the parameter is valid.
+     */
+    bool hasParameter;
+
+    /**
+     * Parameter of the error.
+     */
+    long parameter;
+
 public:
     /**
      * Construct the exception.
      */
-    ProtocolException(errorCode_t errorCode) throw();
+    ProtocolException(errorCode_t errorCode,
+                      bool hasParameter = false, long parameter = 0) throw();
 
     /**
@@ -163,4 +177,9 @@
      */
     errorCode_t getErrorCode() const throw();
+
+    /**
+     * Get the value of the parameter and whether it is valid or not.
+     */
+    bool getParameter(long& param) const throw();
 };
 
@@ -246,4 +265,12 @@
 {
     return errorCode;
+}
+
+//------------------------------------------------------------------------------
+
+inline bool ProtocolException::getParameter(long& param) const throw()
+{
+    if (hasParameter) param = parameter;
+    return hasParameter;
 }
 
Index: src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc	(revision 33)
+++ src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc	(revision 40)
@@ -610,5 +610,5 @@
 
     xplane.stream->flush();
-    xplane.checkResult();
+    xplane.checkResult(true);
 }
 
Index: src/client/c/hu/varadiistvan/xplra/MultiGetter.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiGetter.cc	(revision 33)
+++ src/client/c/hu/varadiistvan/xplra/MultiGetter.cc	(revision 40)
@@ -97,5 +97,5 @@
     xplane.stream->writeU32(registeredID);
     xplane.stream->flush();
-    xplane.checkResult();
+    xplane.checkResult(true);
 
     readValues();
Index: src/client/c/hu/varadiistvan/xplra/MultiSetter.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiSetter.cc	(revision 33)
+++ src/client/c/hu/varadiistvan/xplra/MultiSetter.cc	(revision 40)
@@ -99,5 +99,5 @@
     }
     xplane.stream->flush();
-    xplane.checkResult();
+    xplane.checkResult(true);
 }
 
@@ -121,5 +121,5 @@
     }
     xplane.stream->flush();
-    xplane.checkResult();
+    xplane.checkResult(true);
 }
 
Index: src/client/c/hu/varadiistvan/xplra/XPlane.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 36)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.cc	(revision 40)
@@ -73,5 +73,6 @@
 //------------------------------------------------------------------------------
 
-void XPlane::checkResult(uint8_t result) throw(ProtocolException)
+void XPlane::checkResult(uint8_t result, bool hasParameter, long parameter)
+    throw(ProtocolException)
 {
     switch(result) {
@@ -79,20 +80,31 @@
         return;
       case Protocol::RESULT_INVALID_COMMAND:
-        throw ProtocolException(ProtocolException::INVALID_COMMAND);
+        throw ProtocolException(ProtocolException::INVALID_COMMAND,
+                                hasParameter, parameter);
       case Protocol::RESULT_UNKNOWN_DATAREF:
-        throw ProtocolException(ProtocolException::UNKNOWN_DATAREF);
+        throw ProtocolException(ProtocolException::UNKNOWN_DATAREF,
+                                hasParameter, parameter);
       case Protocol::RESULT_INVALID_TYPE:
-        throw ProtocolException(ProtocolException::INVALID_TYPE);
+        throw ProtocolException(ProtocolException::INVALID_TYPE,
+                                hasParameter, parameter);
       case Protocol::RESULT_INVALID_LENGTH:
-        throw ProtocolException(ProtocolException::INVALID_LENGTH);
+        throw ProtocolException(ProtocolException::INVALID_LENGTH,
+                                hasParameter, parameter);
       case Protocol::RESULT_INVALID_OFFSET:
-        throw ProtocolException(ProtocolException::INVALID_OFFSET);
+        throw ProtocolException(ProtocolException::INVALID_OFFSET,
+                                hasParameter, parameter);
       case Protocol::RESULT_INVALID_COUNT:
-        throw ProtocolException(ProtocolException::INVALID_COUNT);
+        throw ProtocolException(ProtocolException::INVALID_COUNT,
+                                hasParameter, parameter);
       case Protocol::RESULT_INVALID_ID:
-        throw ProtocolException(ProtocolException::INVALID_ID);
+        throw ProtocolException(ProtocolException::INVALID_ID,
+                                hasParameter, parameter);
+      case Protocol::RESULT_INVALID_DURATION:
+        throw ProtocolException(ProtocolException::INVALID_DURATION,
+                                hasParameter, parameter);
       case Protocol::RESULT_OTHER_ERROR:
       default:
-        throw ProtocolException(ProtocolException::OTHER);
+        throw ProtocolException(ProtocolException::OTHER,
+                                hasParameter, parameter);
     }
 }
@@ -100,9 +112,17 @@
 //------------------------------------------------------------------------------
 
-void XPlane::checkResult() throw(ProtocolException, IOException)
+void XPlane::checkResult(bool multi) throw(ProtocolException, IOException)
 {
     uint8_t result = stream->readU8();
-    checkStream();
-    checkResult(result);
+    bool hasParameter = false;
+    long parameter = 0;
+    if (multi) {
+        if (result==Protocol::RESULT_UNKNOWN_DATAREF) {
+            parameter = stream->readU32();
+            hasParameter = true;
+        }
+    }
+    checkStream();
+    checkResult(result, hasParameter, parameter);
 }
 
@@ -205,4 +225,13 @@
 
     checkStream();
+}
+
+//------------------------------------------------------------------------------
+
+void XPlane::reloadPlugins() throw(Exception)
+{
+    stream->writeU8(Protocol::COMMAND_RELOAD_PLUGINS);
+    stream->flush();
+    checkResult();
 }
 
@@ -457,4 +486,16 @@
     }
 }
+
+//------------------------------------------------------------------------------
+
+void XPlane::showMessage(const char* message, float duration) throw(Exception)
+{
+    stream->writeU8(Protocol::COMMAND_SHOW_MESSAGE);
+    stream->writeString(message);
+    stream->writeFloat(duration);
+    stream->flush();
+    checkResult();
+}
+
 //------------------------------------------------------------------------------
 
Index: src/client/c/hu/varadiistvan/xplra/XPlane.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 36)
+++ src/client/c/hu/varadiistvan/xplra/XPlane.h	(revision 40)
@@ -150,4 +150,10 @@
 
     /**
+     * Reload the plugins loaded in X-Plane. After this the connection
+     * fails.
+     */
+    void reloadPlugins() throw(Exception);
+
+    /**
      * Get the integer value of the dataref with the given name.
      */
@@ -271,4 +277,9 @@
                    size_t offset = 0) throw(Exception);
 
+    /**
+     * Show a textual message for a certain duration.
+     */
+    void showMessage(const char* message, float duration) throw(Exception);
+
 private:
     /**
@@ -281,5 +292,6 @@
      * throw a ProtocolException with the correct error code.
      */
-    void checkResult(uint8_t result) throw(ProtocolException);
+    void checkResult(uint8_t result, bool hasParameter = false,
+                     long parameter = 0) throw(ProtocolException);
 
     /**
@@ -288,5 +300,5 @@
      * is some problem with the stream, an IOException is thrown.
      */
-    void checkResult() throw(ProtocolException, IOException);
+    void checkResult(bool multi = false) throw(ProtocolException, IOException);
 
     /**
Index: src/client/c/hu/varadiistvan/xplra/xplra.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 36)
+++ src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 40)
@@ -515,4 +515,19 @@
 //------------------------------------------------------------------------------
 
+extern "C" int xplra_reload_plugins(int connectionID)
+{
+    Connection* connection = ConnectionSlot::getValue(connectionID);
+    if (connection==0) return -1;
+    try {
+        connection->reloadPlugins();
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
 extern "C" int xplra_get_int(int* value, int connectionID, const char* name)
 {
@@ -1267,4 +1282,22 @@
     try {
         return connection->destroyMultiBuffer(bufferID) ? 0 : -1;
+    } catch(...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+extern "C" int xplra_show_message(int connectionID,
+                                  const char* message, float duration)
+{
+    Connection* connection = ConnectionSlot::getValue(connectionID);
+    if (connection==0) return -1;
+
+    try {
+        connection->showMessage(message, duration);
+        return 0;
     } catch(...) {
         connection->handleException();
Index: src/client/c/hu/varadiistvan/xplra/xplra.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 36)
+++ src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 40)
@@ -79,6 +79,9 @@
 #define ERROR_PROTOCOL_INVALID_ID = 7
 
+/** An invalid duration was specified */
+#define ERROR_PROTOCOL_INVALID_DURATION = 8
+
 /** Other protocol error  */
-#define ERROR_PROTOCOL_OTHER = 8
+#define ERROR_PROTOCOL_OTHER = 255
 
 /** A function requiring a connection is called without a connection */
@@ -137,4 +140,11 @@
                        int* xplaneVersion, int* xplmVersion,
                        int* xplraVersion);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Reload the plugins in X-Plane. After this the connection fails.
+ */
+int xplra_reload_plugins(int connectionID);
 
 /*----------------------------------------------------------------------------*/
@@ -720,5 +730,5 @@
 
 /**
- * Destruy a multi-dataref buffer for the given connection.
+ * Destroy a multi-dataref buffer for the given connection.
  *
  * @param connectionID the ID of the connection for which the buffer
@@ -729,4 +739,13 @@
 int xplra_multi_destroy_buffer(int connectionID, int bufferID);
 
+/*----------------------------------------------------------------------------*/
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Show a message in the simulator window for the given duration.
+ */
+int xplra_show_message(int connectionID, const char* message, float duration);
+
+/*----------------------------------------------------------------------------*/
 /*----------------------------------------------------------------------------*/
 
Index: src/client/python/xplra.py
===================================================================
--- src/client/python/xplra.py	(revision 37)
+++ src/client/python/xplra.py	(revision 40)
@@ -30,4 +30,8 @@
 COMMAND_GET_VERSIONS = 0x31
 
+COMMAND_RELOAD_PLUGINS = 0x32
+
+COMMAND_SHOW_MESSAGE = 0x41
+
 TYPE_INT = 0x01
 
@@ -57,4 +61,6 @@
 
 RESULT_INVALID_ID = 0x07
+
+RESULT_INVALID_DURATION = 0x08
 
 RESULT_OTHER_ERROR = 0xff
@@ -71,4 +77,5 @@
                  RESULT_INVALID_COUNT : "invalid count",
                  RESULT_INVALID_ID : "invalid ID",
+                 RESULT_INVALID_DURATION : "invalid duration",
                  RESULT_OTHER_ERROR : "other error" }
 
@@ -81,8 +88,13 @@
             return "unknown error code " + `resultCode`
 
-    def __init__(self, resultCode):
-        super(ProtocolException, self).__init__("xplra.ProtocolException: " +
-                                                self.getMessage(resultCode))
+    def __init__(self, resultCode, parameter = None):
+        message = "xplra.ProtocolException: " + self.getMessage(resultCode)
+        if parameter is not None:
+            if resultCode==RESULT_UNKNOWN_DATAREF:
+                message += " (# %d)" % (parameter,)
+
+        super(ProtocolException, self).__init__(message)
         self.resultCode = resultCode
+        self.parameter = parameter
 
 #-------------------------------------------------------------------------------
@@ -145,4 +157,12 @@
         return (self._readS32(), self._readS32(), self._readS32())
 
+    def reloadPlugins(self):
+        """Reload the plugins in X-Plane.
+
+        After this, this connection becomes invalid."""
+        self._writeU8(COMMAND_RELOAD_PLUGINS)
+        self._flush()
+        self._checkResult();
+
     def getInt(self, name):
         """Get the value of the integer dataref with the given name."""
@@ -212,4 +232,14 @@
         self.setByteArray(name, value, offset)
 
+    def showMessage(self, message, duration):
+        """Show a message in the simulator window for the given duration.
+
+        The duration is a floating-point number denoting seconds."""
+        self._writeU8(COMMAND_SHOW_MESSAGE)
+        self._writeString(message)
+        self._writeFloat(duration)
+        self._flush()
+        self._checkResult()
+
     def disconnect(self):
         """Disconnect from X-Plane."""
@@ -218,5 +248,5 @@
             self._stream = None
 
-    def _checkResult(self, resultCode = None):
+    def _checkResult(self, resultCode = None, parameter = None, multi = False):
         """Check the given result code.
 
@@ -227,6 +257,9 @@
         if resultCode is None:
             resultCode = self._readU8()
+            if multi and resultCode==RESULT_UNKNOWN_DATAREF:
+                parameter = self._readU32()
+
         if resultCode!=RESULT_OK:
-            raise ProtocolException(resultCode)
+            raise ProtocolException(resultCode, parameter)
 
     def _getSingle(self, name, type, length = None, offset = None):
@@ -525,5 +558,5 @@
 
         self._xplane._flush()
-        self._xplane._checkResult()
+        self._xplane._checkResult(multi = True)
 
     def __len__(self):
@@ -591,5 +624,5 @@
         self._xplane._flush()
 
-        self._xplane._checkResult()
+        self._xplane._checkResult(multi = True)
 
         self._readValues()
@@ -623,5 +656,5 @@
         self._xplane._flush()
 
-        self._xplane._checkResult()
+        self._xplane._checkResult(multi = True)
 
     def _executeUnregistered(self):
@@ -644,5 +677,5 @@
 
         self._xplane._flush()
-        self._xplane._checkResult()
-
-#-------------------------------------------------------------------------------
+        self._xplane._checkResult(multi = True)
+
+#-------------------------------------------------------------------------------
