1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2024-12-22 09:31:14 -05:00

allow YSF clients to change linked module by DG-ID

This commit is contained in:
narspt 2021-07-13 00:48:43 +01:00 committed by GitHub
parent 3c3367fee6
commit 32c9e0ce8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,19 @@ void CYsfProtocol::Task(void)
//std::cout << "YSF DV header:" << std::endl << *Header << std::endl;
//std::cout << "YSF DV header:" << std::endl;
// handle changing linked module by DG-ID
if ( (Fich.getSQ() >= 1) && (Fich.getSQ() <= NB_OF_MODULES) ) {
char cModule = 'A' + (char)(Fich.getSQ() - 1);
CClient *client = g_Reflector.GetClients()->FindClient(Ip, PROTOCOL_YSF);
if ( client != NULL ) {
if ( client->GetReflectorModule() != cModule ) {
std::cout << "YSF client " << client->GetCallsign() << " linking by DG-ID on module " << cModule << std::endl;
client->SetReflectorModule(cModule);
}
}
g_Reflector.ReleaseClients();
}
// node linked and callsign muted?
if ( g_GateKeeper.MayTransmit(Header->GetMyCallsign(), Ip, PROTOCOL_YSF, Header->GetRpt2Module()) )
{