]> git.mxchange.org Git - flightgear.git/blobdiff - src/MultiPlayer/multiplaymgr.cxx
ITM radio calculations are only considered valid
[flightgear.git] / src / MultiPlayer / multiplaymgr.cxx
index 271b0acbab3b49b68d09263d25a927c12c2d33f1..d034f7a1c9ec19b6ad2810e3f7e1c938694a58ee 100644 (file)
@@ -432,14 +432,18 @@ FGMultiplayMgr::init (void)
         << txAddress << "'. Multiplayer mode disabled.");
       return;
     } else {
-        SG_LOG(SG_NETWORK, SG_INFO, "FGMultiplayMgr - have server");
+      SG_LOG(SG_NETWORK, SG_INFO, "FGMultiplayMgr - have server");
       mHaveServer = true;
     }
     if (rxPort <= 0)
       rxPort = txPort;
+  } else {
+    SG_LOG(SG_NETWORK, SG_INFO, "FGMultiplayMgr - no transmission address. Multiplayer mode disabled");
+    return;
   }
+
   if (rxPort <= 0) {
-    SG_LOG(SG_NETWORK, SG_ALERT,
+    SG_LOG(SG_NETWORK, SG_INFO,
       "FGMultiplayMgr - No receiver port. Multiplayer mode disabled.");
     return;
   }
@@ -454,7 +458,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);
@@ -471,6 +475,8 @@ FGMultiplayMgr::init (void)
   
   fgSetBool("/sim/multiplay/online", true);
   mInitialised = true;
+
+  SG_LOG(SG_NETWORK, SG_ALERT, "Multiplayer mode active!");
 } // FGMultiplayMgr::init()
 //////////////////////////////////////////////////////////////////////
 
@@ -638,7 +644,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)
@@ -962,10 +969,10 @@ FGMultiplayMgr::Send()
     }
 
     double sim_time = globals->get_sim_time_sec();
-    static double lastTime = 0.0;
+//    static double lastTime = 0.0;
     
    // SG_LOG(SG_GENERAL, SG_INFO, "actual dt=" << sim_time - lastTime);
-    lastTime = sim_time;
+//    lastTime = sim_time;
     
     FlightProperties ifce;
 
@@ -1306,7 +1313,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);