]> git.mxchange.org Git - flightgear.git/blobdiff - src/MultiPlayer/mpmessages.hxx
Maik JUSTUS: change /rotors/*/blade1_pos to /rotors/*/blade[0]/position-deg,
[flightgear.git] / src / MultiPlayer / mpmessages.hxx
index 523c555c69304c587522a458f1201382450d91d6..12655a0cedd60bab97b5173d09dfdcf5ccce50ac 100644 (file)
@@ -18,7 +18,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 
 #ifndef MPMESSAGES_H
@@ -39,6 +39,7 @@
 
 #include <plib/sg.h>
 #include <simgear/compiler.h>
+#include <simgear/props/props.hxx>
 #include <simgear/math/SGMath.hxx>
 #include "tiny_xdr.hxx"
 
@@ -109,17 +110,27 @@ struct T_PositionMsg {
     xdr_data_t angularAccel[3];
 };
 
-// Property message
-struct T_PropertyMsg {
-    xdr_data_t id;
-    xdr_data_t value;
-};
-
-struct FGFloatPropertyData {
+struct FGPropertyData {
   unsigned id;
-  float value;
+  
+  // While the type isn't transmitted, it is needed for the destructor
+  SGPropertyNode::Type type;
+  union { 
+    int int_value;
+    float float_value;
+    char* string_value;
+  }; 
+  
+  ~FGPropertyData() {
+    if ((type == SGPropertyNode::STRING) || (type == SGPropertyNode::UNSPECIFIED))
+    {
+      delete [] string_value;
+    }
+  }
 };
 
+
+
 // Position message
 struct FGExternalMotionData {
   // simulation time when this packet was generated
@@ -149,7 +160,7 @@ struct FGExternalMotionData {
   SGVec3f angularAccel;
   
   // The set of properties recieved for this timeslot
-  std::vector<FGFloatPropertyData> properties;
+  std::vector<FGPropertyData*> properties;
 };
 
 #endif