mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 20:55:42 +08:00
Change voice room callsign format to "callsign (userid)"
So far the callsign, was the callsign itself only. However, other VATSIM clients expect it to include the user id in brackets. ref T354
This commit is contained in:
committed by
Klaus Basan
parent
89ab1a0138
commit
321c195f4b
@@ -310,6 +310,7 @@ namespace BlackCore
|
|||||||
CVoiceRoom newRoomCom1 = newRooms[0];
|
CVoiceRoom newRoomCom1 = newRooms[0];
|
||||||
CVoiceRoom newRoomCom2 = newRooms[1];
|
CVoiceRoom newRoomCom2 = newRooms[1];
|
||||||
const CCallsign ownCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
const CCallsign ownCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||||
|
QString id = this->getIContextOwnAircraft()->getOwnAircraft().getPilotId();
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
@@ -337,6 +338,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
QSharedPointer<IVoiceChannel> newVoiceChannel = this->getVoiceChannelBy(newRoomCom1);
|
QSharedPointer<IVoiceChannel> newVoiceChannel = this->getVoiceChannelBy(newRoomCom1);
|
||||||
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
||||||
|
newVoiceChannel->setUserId(id);
|
||||||
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
||||||
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel);
|
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel);
|
||||||
|
|
||||||
@@ -377,6 +379,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
auto newVoiceChannel = getVoiceChannelBy(newRoomCom2);
|
auto newVoiceChannel = getVoiceChannelBy(newRoomCom2);
|
||||||
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
||||||
|
newVoiceChannel->setUserId(id);
|
||||||
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
||||||
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com2, newVoiceChannel);
|
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com2, newVoiceChannel);
|
||||||
|
|
||||||
|
|||||||
@@ -58,9 +58,10 @@ namespace BlackCore
|
|||||||
|
|
||||||
// No one else is using this voice room, so prepare to join
|
// No one else is using this voice room, so prepare to join
|
||||||
m_voiceRoom = voiceRoom;
|
m_voiceRoom = voiceRoom;
|
||||||
|
QString callsign = QString("%1 (%2)").arg(m_callsign.toQString()).arg(m_userId);
|
||||||
Vat_SetRoomInfo(m_voiceChannel.data(), qPrintable(voiceRoom.getHostname()), 3782,
|
Vat_SetRoomInfo(m_voiceChannel.data(), qPrintable(voiceRoom.getHostname()), 3782,
|
||||||
qPrintable(voiceRoom.getChannel()),
|
qPrintable(voiceRoom.getChannel()),
|
||||||
qPrintable(m_callsign.toQString()));
|
qPrintable(callsign));
|
||||||
|
|
||||||
CLogMessage(this).debug() << "Joining voice room " << m_voiceRoom.getVoiceRoomUrl();
|
CLogMessage(this).debug() << "Joining voice room " << m_voiceRoom.getVoiceRoomUrl();
|
||||||
Vat_JoinRoom(m_voiceChannel.data());
|
Vat_JoinRoom(m_voiceChannel.data());
|
||||||
@@ -88,6 +89,11 @@ namespace BlackCore
|
|||||||
m_callsign = callsign;
|
m_callsign = callsign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CVoiceChannelVatlib::setUserId(const QString &id)
|
||||||
|
{
|
||||||
|
m_userId = id;
|
||||||
|
}
|
||||||
|
|
||||||
BlackMisc::Audio::CVoiceRoom CVoiceChannelVatlib::getVoiceRoom() const
|
BlackMisc::Audio::CVoiceRoom CVoiceChannelVatlib::getVoiceRoom() const
|
||||||
{
|
{
|
||||||
return m_voiceRoom;
|
return m_voiceRoom;
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ namespace BlackCore
|
|||||||
//! \copydoc IVoiceChannel::setOwnAircraftCallsign
|
//! \copydoc IVoiceChannel::setOwnAircraftCallsign
|
||||||
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) override;
|
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||||
|
|
||||||
|
//! \copydoc IVoiceChannel::setUserId
|
||||||
|
virtual void setUserId(const QString &id) override;
|
||||||
|
|
||||||
//! \copydoc IVoiceChannel::getVoiceRoom
|
//! \copydoc IVoiceChannel::getVoiceRoom
|
||||||
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const override;
|
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const override;
|
||||||
|
|
||||||
@@ -94,6 +97,7 @@ namespace BlackCore
|
|||||||
static void roomStatusUpdate(VatVoiceChannel *channel, VatConnectionStatus oldStatus, VatConnectionStatus newStatus, void *cbVar);
|
static void roomStatusUpdate(VatVoiceChannel *channel, VatConnectionStatus oldStatus, VatConnectionStatus newStatus, void *cbVar);
|
||||||
|
|
||||||
BlackMisc::Aviation::CCallsign m_callsign; // Own callsign
|
BlackMisc::Aviation::CCallsign m_callsign; // Own callsign
|
||||||
|
QString m_userId; // Pilot user id
|
||||||
BlackMisc::Audio::CVoiceRoom m_voiceRoom; // Voice Room
|
BlackMisc::Audio::CVoiceRoom m_voiceRoom; // Voice Room
|
||||||
BlackMisc::Aviation::CCallsignSet m_listCallsigns; // Callsigns connected to room
|
BlackMisc::Aviation::CCallsignSet m_listCallsigns; // Callsigns connected to room
|
||||||
IVoiceChannel::ConnectionStatus m_roomStatus = IVoiceChannel::Disconnected; // Room connection status
|
IVoiceChannel::ConnectionStatus m_roomStatus = IVoiceChannel::Disconnected; // Room connection status
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ namespace BlackCore
|
|||||||
//! Set own aircraft's callsign
|
//! Set own aircraft's callsign
|
||||||
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||||
|
|
||||||
|
//! Set user id
|
||||||
|
virtual void setUserId(const QString &id) = 0;
|
||||||
|
|
||||||
//! Get voice room
|
//! Get voice room
|
||||||
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const = 0;
|
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user