mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 20:55:42 +08:00
refs #334 Make player info member variables
This commit is contained in:
@@ -204,20 +204,18 @@ namespace BlackSimPlugin
|
|||||||
callsign.toWCharArray(wszPlayername.data());
|
callsign.toWCharArray(wszPlayername.data());
|
||||||
wszPlayername[callsign.size()] = 0;
|
wszPlayername[callsign.size()] = 0;
|
||||||
|
|
||||||
PLAYER_INFO_STRUCT playerInfo;
|
ZeroMemory(&m_playerInfo, sizeof (PLAYER_INFO_STRUCT) );
|
||||||
ZeroMemory(&playerInfo, sizeof (PLAYER_INFO_STRUCT) );
|
strcpy (m_playerInfo.szAircraft, "Boeing 737-400 Paint1");
|
||||||
strcpy (playerInfo.szAircraft, "Boeing 737-400 Paint1");
|
m_playerInfo.dwFlags = 6;
|
||||||
playerInfo.dwFlags = 6;
|
|
||||||
|
|
||||||
// Prepare and set the player information structure.
|
// Prepare and set the player information structure.
|
||||||
DPN_PLAYER_INFO player;
|
ZeroMemory( &m_player, sizeof( DPN_PLAYER_INFO ) );
|
||||||
ZeroMemory( &player, sizeof( DPN_PLAYER_INFO ) );
|
m_player.dwSize = sizeof( DPN_PLAYER_INFO );
|
||||||
player.dwSize = sizeof( DPN_PLAYER_INFO );
|
m_player.pvData = &m_playerInfo;
|
||||||
player.pvData = &playerInfo;
|
m_player.dwDataSize = sizeof( PLAYER_INFO_STRUCT );
|
||||||
player.dwDataSize = sizeof( PLAYER_INFO_STRUCT );
|
m_player.dwInfoFlags = DPNINFO_NAME | DPNINFO_DATA;
|
||||||
player.dwInfoFlags = DPNINFO_NAME | DPNINFO_DATA;
|
m_player.pwszName = wszPlayername.data();
|
||||||
player.pwszName = wszPlayername.data();
|
if( FAILED( hr = m_directPlayPeer->SetPeerInfo( &m_player, nullptr, nullptr, DPNSETPEERINFO_SYNC ) ) )
|
||||||
if( FAILED( hr = m_directPlayPeer->SetPeerInfo( &player, nullptr, nullptr, DPNSETPEERINFO_SYNC ) ) )
|
|
||||||
{
|
{
|
||||||
qWarning() << "Failed to set peer info!";
|
qWarning() << "Failed to set peer info!";
|
||||||
return hr;
|
return hr;
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ namespace BlackSimPlugin
|
|||||||
QMutex m_mutexInterpolator;
|
QMutex m_mutexInterpolator;
|
||||||
IDirectPlay8Address *m_hostAddress = nullptr;
|
IDirectPlay8Address *m_hostAddress = nullptr;
|
||||||
ClientStatus m_clientStatus = Disconnected;
|
ClientStatus m_clientStatus = Disconnected;
|
||||||
|
|
||||||
|
PLAYER_INFO_STRUCT m_playerInfo;
|
||||||
|
DPN_PLAYER_INFO m_player;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user