mirror of
https://github.com/g4klx/ircDDBGateway.git
synced 2026-04-06 06:43:52 +00:00
Add G2 port caching
This commit is contained in:
parent
21b1b967be
commit
bf4738c8a2
4 changed files with 48 additions and 13 deletions
|
|
@ -91,6 +91,11 @@ CRepeaterData* CCacheManager::findRepeater(const wxString& repeater)
|
|||
}
|
||||
|
||||
void CCacheManager::updateUser(const wxString& user, const wxString& repeater, const wxString& gateway, const wxString& address, const wxString& timestamp, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
updateUser(user, repeater, gateway, address, G2_DV_PORT, true, timestamp, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateUser(const wxString& user, const wxString& repeater, const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, const wxString& timestamp, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
wxMutexLocker locker(m_mutex);
|
||||
|
||||
|
|
@ -103,10 +108,15 @@ void CCacheManager::updateUser(const wxString& user, const wxString& repeater, c
|
|||
if (!repeater7.IsSameAs(gateway7))
|
||||
m_repeaterCache.update(repeater, gateway);
|
||||
|
||||
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
|
||||
updateGateway(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gateway, const wxString& address, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
updateRepeater(repeater, gateway, address, G2_DV_PORT, true, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
wxMutexLocker locker(m_mutex);
|
||||
|
||||
|
|
@ -117,12 +127,24 @@ void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gat
|
|||
if (!repeater7.IsSameAs(gateway7))
|
||||
m_repeaterCache.update(repeater, gateway);
|
||||
|
||||
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
|
||||
updateGateway(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateGateway(const wxString& gateway, const wxString& address, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
updateGateway(gateway, address, G2_DV_PORT, true, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateGateway(const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
{
|
||||
wxMutexLocker locker(m_mutex);
|
||||
|
||||
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
|
||||
m_gatewayCache.update(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
|
||||
}
|
||||
|
||||
void CCacheManager::updateGatewayG2(const wxString& gateway, const wxString& address, unsigned int g2Port)
|
||||
{
|
||||
CGatewayRecord* gr = m_gatewayCache.find(gateway);
|
||||
DSTAR_PROTOCOL protocol = gr != NULL? gr->getProtocol() : DP_UNKNOWN;
|
||||
updateGateway(gateway, address, g2Port, false, protocol, false, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue