#include <iostream>
#include <algorithm>
#include <cstring>
+#include <errno.h>
#include <osg/Math> // isNaN
#include <simgear/misc/stdint.hxx>
{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},
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;
}
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);
fgSetBool("/sim/multiplay/online", true);
mInitialised = true;
+
+ SG_LOG(SG_NETWORK, SG_ALERT, "Multiplayer mode active!");
} // FGMultiplayMgr::init()
//////////////////////////////////////////////////////////////////////
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)
}
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;
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);