mDataRxSocket = new netSocket();
if (!mDataRxSocket->open(false)) {
// Failed to open rx socket
- cerr << "FGMultiplayRxMgr::Open - Failed to create data receive socket" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::Open - Failed to create data receive socket" );
bSuccess = false;
} else {
if (mDataRxSocket->bind(m_sRxAddress.c_str(), m_iRxPort) != 0) {
perror("bind");
// Failed to bind
- cerr << "FGMultiplayRxMgr::Open - Failed to bind receive socket" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::Open - Failed to bind receive socket" );
bSuccess = false;
}
m_bInitialised = bSuccess;
} else {
- cerr << "FGMultiplayRxMgr::OpenRx - Receiver open requested when receiver is already open" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::OpenRx - Receiver open requested when receiver is already open" );
bSuccess = false;
}
// Check if the player was added
if (!bActivePlayer) {
if (iPlayerCnt == MAX_PLAYERS) {
- cerr << "FGMultiplayRxMgr::MP_ProcessData - Unable to add new player (" << sCallsign << "). Too many players." << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::MP_ProcessData - Unable to add new player (" << sCallsign << "). Too many players." );
}
}
}
} else {
- cerr << "FGMultiplayRxMgr::MP_ProcessData - Position message received with insufficient data" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::MP_ProcessData - Position message received with insufficient data" );
}
break;
default:
- cerr << "FGMultiplayRxMgr::MP_ProcessData - Unknown message Id received: " << MsgHdr->MsgId << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::MP_ProcessData - Unknown message Id received: " << MsgHdr->MsgId );
break;
mDataTxSocket = new netSocket();
if (!mDataTxSocket->open(false)) {
// Failed to open tx socket
- cerr << "FGMultiplayTxMgr::init - Failed to create data transmit socket" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayTxMgr::init - Failed to create data transmit socket" );
bSuccess = false;
} else {
mDataTxSocket->setBroadcast(true);
if (mDataTxSocket->connect(sTxAddress.c_str(), iTxPort) != 0) {
// Failed to connect tx socket
- cerr << "FGMultiplayTxMgr::init - Failed to connect data transmit socket" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayTxMgr::init - Failed to connect data transmit socket" );
bSuccess = false;
}
}
mLocalPlayer = new MPPlayer();
if (!mLocalPlayer->Open(fgGetString("/sim/multiplay/rxhost"), fgGetInt("/sim/multiplay/rxport"),
fgGetString("/sim/multiplay/callsign"), fgGetString("/sim/model/path"), true)) {
- cerr << "FGMultiplayTxMgr::init - Failed to create player object for local player" << endl;
+ SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayTxMgr::init - Failed to create player object for local player" );
bSuccess = false;
}
}