]> git.mxchange.org Git - flightgear.git/blobdiff - src/MultiPlayer/multiplaymgr.cxx
Fix shared library build for metar executable
[flightgear.git] / src / MultiPlayer / multiplaymgr.cxx
index 5683a58d9946953d0f1be9488236478ce89102bd..123317c63536b25d5d9893f8fd13a41a7e09055c 100644 (file)
@@ -34,6 +34,7 @@
 #include <iostream>
 #include <algorithm>
 #include <cstring>
+#include <errno.h>
 #include <osg/Math>             // isNaN
 
 #include <simgear/misc/stdint.hxx>
@@ -171,6 +172,8 @@ static const IdPropertyList sIdPropertyList[] = {
 
   {1300, "tanker", simgear::props::INT},
 
+  {1400, "scenery/events", simgear::props::STRING},
+
   {10001, "sim/multiplay/transmission-freq-hz",  simgear::props::STRING},
   {10002, "sim/multiplay/chat",  simgear::props::STRING},
 
@@ -436,7 +439,7 @@ FGMultiplayMgr::init (void)
       rxPort = txPort;
   }
   if (rxPort <= 0) {
-    SG_LOG(SG_NETWORK, SG_ALERT,
+    SG_LOG(SG_NETWORK, SG_INFO,
       "FGMultiplayMgr - No receiver port. Multiplayer mode disabled.");
     return;
   }
@@ -451,7 +454,7 @@ FGMultiplayMgr::init (void)
   mSocket.reset(new simgear::Socket());
   if (!mSocket->open(false)) {
     SG_LOG( SG_NETWORK, SG_WARN,
-            "FGMultiplayMgr - Failed to create data socket." );
+            "FGMultiplayMgr - Failed to create data socket. Multiplayer mode disabled." );
     return;
   }
   mSocket->setBlocking(false);
@@ -468,6 +471,8 @@ FGMultiplayMgr::init (void)
   
   fgSetBool("/sim/multiplay/online", true);
   mInitialised = true;
+
+  SG_LOG(SG_NETWORK, SG_ALERT, "Multiplayer mode active!");
 } // FGMultiplayMgr::init()
 //////////////////////////////////////////////////////////////////////
 
@@ -635,7 +640,8 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
 
   strncpy(PosMsg->Model, fgGetString("/sim/model/path"), MAX_MODEL_NAME_LEN);
   PosMsg->Model[MAX_MODEL_NAME_LEN - 1] = '\0';
-  if (fgGetBool("/sim/freeze/replay-state", true))
+  if (fgGetBool("/sim/freeze/replay-state", true)&&
+      fgGetBool("/sim/multiplay/freeze-on-replay",true))
   {
       // do not send position updates during replay
       for (unsigned i = 0 ; i < 3; ++i)
@@ -1303,7 +1309,7 @@ FGMultiplayMgr::addMultiplayer(const std::string& callsign,
   mp->setCallSign(callsign);
   mMultiPlayerMap[callsign] = mp;
 
-  FGAIManager *aiMgr = (FGAIManager*)globals->get_subsystem("ai_model");
+  FGAIManager *aiMgr = (FGAIManager*)globals->get_subsystem("ai-model");
   if (aiMgr) {
     aiMgr->attach(mp);