Latest MultiPlayer updates
This commit is contained in:
parent
9914cfa93c
commit
2b151fd7f3
3 changed files with 10 additions and 10 deletions
|
@ -109,7 +109,7 @@ bool MPPlayer::Open(const string &sAddress, const int &iPort, const string &sCal
|
|||
m_bInitialised = bSuccess;
|
||||
|
||||
} else {
|
||||
cerr << "MPPlayer::Open - Attempt to open an already open player connection." << endl;
|
||||
SG_LOG( SG_NETWORK, SG_ALERT, "MPPlayer::Open - Attempt to open an already open player connection." );
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ bool FGMultiplayRxMgr::init(void) {
|
|||
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 {
|
||||
|
||||
|
@ -145,7 +145,7 @@ bool FGMultiplayRxMgr::init(void) {
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ bool FGMultiplayRxMgr::init(void) {
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -288,18 +288,18 @@ void FGMultiplayRxMgr::ProcessData(void) {
|
|||
// 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;
|
||||
|
||||
|
||||
|
|
|
@ -109,13 +109,13 @@ bool FGMultiplayTxMgr::init(void) {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ bool FGMultiplayTxMgr::init(void) {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue