Index: src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc	(revision 21)
+++ src/client/c/hu/varadiistvan/xplra/MultiBuffer.cc	(revision 22)
@@ -46,4 +46,5 @@
 using xplra::Protocol;
 
+using std::vector;
 using std::string;
 using std::min;
@@ -231,8 +232,10 @@
 //------------------------------------------------------------------------------
 
-MultiBuffer::MultiBuffer(XPlane& xplane) throw() :
+MultiBuffer::MultiBuffer(XPlane& xplane, uint8_t registerCommand,
+                         uint8_t unregisterCommand) throw() :
     data(0),
     xplane(xplane),
-    unregisterCommand(0),
+    registerCommand(registerCommand),
+    unregisterCommand(unregisterCommand),
     registeredID(-1)
 {
@@ -329,5 +332,18 @@
         xplane.checkStream();
 
-        unregisterCommand = doRegister();
+        xplane.stream->writeU8(registerCommand);
+        xplane.stream->writeU32(dataRefs.size());
+
+        for(vector<DataRef>::const_iterator i = dataRefs.begin();
+            i!=dataRefs.end(); ++i)
+        {
+            const DataRef& dataRef = *i;
+            xplane.stream->writeString(dataRef.name);
+            xplane.stream->writeU8(dataRef.type);
+            if (dataRef.isArray()) {
+                xplane.stream->writeS32(dataRef.length);
+                xplane.stream->writeS32(dataRef.offset);
+            }
+        }
 
         xplane.stream->flush();
Index: src/client/c/hu/varadiistvan/xplra/MultiBuffer.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiBuffer.h	(revision 19)
+++ src/client/c/hu/varadiistvan/xplra/MultiBuffer.h	(revision 22)
@@ -133,4 +133,9 @@
 
     /**
+     * The command to use for registering the buffer.
+     */
+    uint8_t registerCommand;
+
+    /**
      * The command to unregister the buffer.
      */
@@ -147,5 +152,6 @@
      * Construct an empty buffer for the given XPlane instance.
      */
-    MultiBuffer(XPlane& xplane) throw();
+    MultiBuffer(XPlane& xplane, uint8_t registerCommand,
+                uint8_t unregisterCommand) throw();
 
 public:
@@ -452,10 +458,4 @@
 
 protected:
-    /**
-     * Perform the first part of the registration depending on the
-     * actual type.
-     */
-    virtual uint8_t doRegister() throw(Exception) = 0;
-
     /**
      * Perform the main part of the execution if the buffer is
Index: src/client/c/hu/varadiistvan/xplra/MultiGetter.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiGetter.cc	(revision 19)
+++ src/client/c/hu/varadiistvan/xplra/MultiGetter.cc	(revision 22)
@@ -50,4 +50,12 @@
 //------------------------------------------------------------------------------
 
+MultiGetter::MultiGetter(XPlane& xplane) throw() :
+    MultiBuffer(xplane, Protocol::COMMAND_REGISTER_GET_MULTI,
+                Protocol::COMMAND_UNREGISTER_GET_MULTI)
+{
+}
+
+//------------------------------------------------------------------------------
+
 inline void MultiGetter::read(const DataRef& dataRef) throw(Exception)
 {
@@ -79,26 +87,4 @@
       }
     }
-}
-
-//------------------------------------------------------------------------------
-
-uint8_t MultiGetter::doRegister() throw(Exception)
-{
-    xplane.stream->writeU8(Protocol::COMMAND_REGISTER_GET_MULTI);
-    xplane.stream->writeU32(dataRefs.size());
-
-    for(vector<DataRef>::const_iterator i = dataRefs.begin();
-        i!=dataRefs.end(); ++i)
-    {
-        const DataRef& dataRef = *i;
-        xplane.stream->writeString(dataRef.name);
-        xplane.stream->writeU8(dataRef.type);
-        if (dataRef.isArray()) {
-            xplane.stream->writeS32(dataRef.length);
-            xplane.stream->writeS32(dataRef.offset);
-        }
-    }
-
-    return Protocol::COMMAND_UNREGISTER_GET_MULTI;
 }
 
Index: src/client/c/hu/varadiistvan/xplra/MultiGetter.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiGetter.h	(revision 19)
+++ src/client/c/hu/varadiistvan/xplra/MultiGetter.h	(revision 22)
@@ -52,9 +52,4 @@
 protected:
     /**
-     * @see MultiBuffer::doRegister
-     */
-    virtual uint8_t doRegister() throw(Exception);
-
-    /**
      * @see MultiBuffer::doExecute
      */
@@ -75,13 +70,4 @@
 
 //------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline MultiGetter::MultiGetter(XPlane& xplane) throw() :
-    MultiBuffer(xplane)
-{
-}
-
-//------------------------------------------------------------------------------
 
 } /* namespace hu::varadiistvan::xplra */ } /* namespace hu::varadiistvan */ } /* namespace hu */
Index: src/client/c/hu/varadiistvan/xplra/MultiSetter.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiSetter.cc	(revision 21)
+++ src/client/c/hu/varadiistvan/xplra/MultiSetter.cc	(revision 22)
@@ -47,4 +47,11 @@
 
 //------------------------------------------------------------------------------
+
+MultiSetter::MultiSetter(XPlane& xplane) throw() :
+    MultiBuffer(xplane, Protocol::COMMAND_REGISTER_SET_MULTI,
+                Protocol::COMMAND_UNREGISTER_SET_MULTI)
+{
+}
+
 //------------------------------------------------------------------------------
 
@@ -76,27 +83,4 @@
       }
     }
-}
-
-//------------------------------------------------------------------------------
-
-uint8_t MultiSetter::doRegister() throw(Exception)
-{
-    // FIXME: only the commands differ from those of MultiGetter
-    xplane.stream->writeU8(Protocol::COMMAND_REGISTER_SET_MULTI);
-    xplane.stream->writeU32(dataRefs.size());
-
-    for(vector<DataRef>::const_iterator i = dataRefs.begin();
-        i!=dataRefs.end(); ++i)
-    {
-        const DataRef& dataRef = *i;
-        xplane.stream->writeString(dataRef.name);
-        xplane.stream->writeU8(dataRef.type);
-        if (dataRef.isArray()) {
-            xplane.stream->writeS32(dataRef.length);
-            xplane.stream->writeS32(dataRef.offset);
-        }
-    }
-
-    return Protocol::COMMAND_UNREGISTER_SET_MULTI;
 }
 
Index: src/client/c/hu/varadiistvan/xplra/MultiSetter.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/MultiSetter.h	(revision 21)
+++ src/client/c/hu/varadiistvan/xplra/MultiSetter.h	(revision 22)
@@ -52,9 +52,4 @@
 protected:
     /**
-     * @see MultiBuffer::doRegister
-     */
-    virtual uint8_t doRegister() throw(Exception);
-
-    /**
      * @see MultiBuffer::doExecute
      */
@@ -75,13 +70,4 @@
 
 //------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline MultiSetter::MultiSetter(XPlane& xplane) throw() :
-    MultiBuffer(xplane)
-{
-}
-
-//------------------------------------------------------------------------------
 
 } /* namespace hu::varadiistvan::xplra */ } /* namespace hu::varadiistvan */ } /* namespace hu */
Index: test/multigettest.cc
===================================================================
--- test/multigettest.cc	(revision 20)
+++ test/multigettest.cc	(revision 22)
@@ -115,5 +115,4 @@
         const int32_t& days = getter.getIntRef(daysID);
         const float& zuluSec = getter.getFloatRef(zuluSecID);
-        printf("AAA2\n");
         const int32_t& paused = getter.getIntRef(pausedID);
         const double& latitude = getter.getDoubleRef(latitudeID);
