|
|
@ -3883,30 +3883,67 @@ bool CNetManager::update()
|
|
|
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
|
|
|
if (im)
|
|
|
|
if (im)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCDBNodeLeaf *node = m_PingLeaf ? &*m_PingLeaf
|
|
|
|
CCDBNodeLeaf *node = NULL;
|
|
|
|
: &*(m_PingLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PING", false));
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
if (!m_PingLeaf)
|
|
|
|
node->setValue32(getPing());
|
|
|
|
m_PingLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PING", false);
|
|
|
|
node = m_UploadLeaf ? &*m_UploadLeaf
|
|
|
|
|
|
|
|
: &*(m_UploadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:UPLOAD", false));
|
|
|
|
if (m_PingLeaf)
|
|
|
|
if (node)
|
|
|
|
{
|
|
|
|
node->setValue32((sint32)(getMeanUpload()*1024.f/8.f));
|
|
|
|
node = &*m_PingLeaf;
|
|
|
|
node = m_DownloadLeaf ? &*m_DownloadLeaf
|
|
|
|
if (node)
|
|
|
|
: &*(m_DownloadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DOWNLOAD", false));
|
|
|
|
node->setValue32(getPing());
|
|
|
|
if (node)
|
|
|
|
}
|
|
|
|
node->setValue32((sint32)(getMeanDownload()*1024.f/8.f));
|
|
|
|
|
|
|
|
node = m_PacketLostLeaf ? &* m_PacketLostLeaf
|
|
|
|
if (!m_UploadLeaf)
|
|
|
|
: &*(m_PacketLostLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PACKETLOST", false));
|
|
|
|
m_UploadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:UPLOAD", false);
|
|
|
|
if (node)
|
|
|
|
|
|
|
|
node->setValue32((sint32)getMeanPacketLoss());
|
|
|
|
if (m_UploadLeaf)
|
|
|
|
node = m_ServerStateLeaf ? &*m_ServerStateLeaf
|
|
|
|
{
|
|
|
|
: &*(m_ServerStateLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SERVERSTATE", false));
|
|
|
|
node = &*m_UploadLeaf;
|
|
|
|
if (node)
|
|
|
|
if (node)
|
|
|
|
node->setValue32((sint32)getConnectionState());
|
|
|
|
node->setValue32((sint32)(getMeanUpload()*1024.f/8.f));
|
|
|
|
node = m_ConnectionQualityLeaf ? &*m_ConnectionQualityLeaf
|
|
|
|
}
|
|
|
|
: &*(m_ConnectionQualityLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CONNECTION_QUALITY", false));
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
if (!m_DownloadLeaf)
|
|
|
|
node->setValue32((sint32)getConnectionQuality());
|
|
|
|
m_DownloadLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DOWNLOAD", false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_DownloadLeaf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
node = &*m_DownloadLeaf;
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
|
|
|
|
node->setValue32((sint32)(getMeanDownload()*1024.f/8.f));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_PacketLostLeaf)
|
|
|
|
|
|
|
|
m_PacketLostLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:PACKETLOST", false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_PacketLostLeaf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
node = &*m_PacketLostLeaf;
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
|
|
|
|
node->setValue32((sint32)getMeanPacketLoss());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_ServerStateLeaf)
|
|
|
|
|
|
|
|
m_ServerStateLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SERVERSTATE", false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_ServerStateLeaf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
node = &*m_ServerStateLeaf;
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
|
|
|
|
node->setValue32((sint32)getConnectionState());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_ConnectionQualityLeaf)
|
|
|
|
|
|
|
|
m_ConnectionQualityLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CONNECTION_QUALITY", false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_ConnectionQualityLeaf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
node = &*m_ConnectionQualityLeaf;
|
|
|
|
|
|
|
|
if (node)
|
|
|
|
|
|
|
|
node->setValue32((sint32)getConnectionQuality());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|