mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +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 newRoomCom2 = newRooms[1];
|
||||
const CCallsign ownCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||
QString id = this->getIContextOwnAircraft()->getOwnAircraft().getPilotId();
|
||||
|
||||
bool changed = false;
|
||||
|
||||
@@ -337,6 +338,7 @@ namespace BlackCore
|
||||
{
|
||||
QSharedPointer<IVoiceChannel> newVoiceChannel = this->getVoiceChannelBy(newRoomCom1);
|
||||
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
||||
newVoiceChannel->setUserId(id);
|
||||
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
||||
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel);
|
||||
|
||||
@@ -377,6 +379,7 @@ namespace BlackCore
|
||||
{
|
||||
auto newVoiceChannel = getVoiceChannelBy(newRoomCom2);
|
||||
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
||||
newVoiceChannel->setUserId(id);
|
||||
bool inUse = m_voiceChannelMapping.values().contains(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
|
||||
m_voiceRoom = voiceRoom;
|
||||
QString callsign = QString("%1 (%2)").arg(m_callsign.toQString()).arg(m_userId);
|
||||
Vat_SetRoomInfo(m_voiceChannel.data(), qPrintable(voiceRoom.getHostname()), 3782,
|
||||
qPrintable(voiceRoom.getChannel()),
|
||||
qPrintable(m_callsign.toQString()));
|
||||
qPrintable(callsign));
|
||||
|
||||
CLogMessage(this).debug() << "Joining voice room " << m_voiceRoom.getVoiceRoomUrl();
|
||||
Vat_JoinRoom(m_voiceChannel.data());
|
||||
@@ -88,6 +89,11 @@ namespace BlackCore
|
||||
m_callsign = callsign;
|
||||
}
|
||||
|
||||
void CVoiceChannelVatlib::setUserId(const QString &id)
|
||||
{
|
||||
m_userId = id;
|
||||
}
|
||||
|
||||
BlackMisc::Audio::CVoiceRoom CVoiceChannelVatlib::getVoiceRoom() const
|
||||
{
|
||||
return m_voiceRoom;
|
||||
|
||||
@@ -55,6 +55,9 @@ namespace BlackCore
|
||||
//! \copydoc IVoiceChannel::setOwnAircraftCallsign
|
||||
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
//! \copydoc IVoiceChannel::setUserId
|
||||
virtual void setUserId(const QString &id) override;
|
||||
|
||||
//! \copydoc IVoiceChannel::getVoiceRoom
|
||||
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const override;
|
||||
|
||||
@@ -94,6 +97,7 @@ namespace BlackCore
|
||||
static void roomStatusUpdate(VatVoiceChannel *channel, VatConnectionStatus oldStatus, VatConnectionStatus newStatus, void *cbVar);
|
||||
|
||||
BlackMisc::Aviation::CCallsign m_callsign; // Own callsign
|
||||
QString m_userId; // Pilot user id
|
||||
BlackMisc::Audio::CVoiceRoom m_voiceRoom; // Voice Room
|
||||
BlackMisc::Aviation::CCallsignSet m_listCallsigns; // Callsigns connected to room
|
||||
IVoiceChannel::ConnectionStatus m_roomStatus = IVoiceChannel::Disconnected; // Room connection status
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace BlackCore
|
||||
//! Set own aircraft's callsign
|
||||
virtual void setOwnAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||
|
||||
//! Set user id
|
||||
virtual void setUserId(const QString &id) = 0;
|
||||
|
||||
//! Get voice room
|
||||
virtual BlackMisc::Audio::CVoiceRoom getVoiceRoom() const = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user