mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
Add forgotten commit data from #3772
Change filename `serverlist_urls.cfg` → `ddnet-serverlist-urls.cfg`, change filename `cache.sqlite3` → `ddnet-cache.sqlite3`, add `const` to a variable and change pings to just before multiples of 100. Fixes #3853.
This commit is contained in:
parent
25f0154949
commit
bfef7c9ba3
|
@ -1648,9 +1648,9 @@ int CServerInfo::EstimateLatency(int Loc1, int Loc2)
|
||||||
}
|
}
|
||||||
if(Loc1 != Loc2)
|
if(Loc1 != Loc2)
|
||||||
{
|
{
|
||||||
return 149;
|
return 199;
|
||||||
}
|
}
|
||||||
return 49;
|
return 99;
|
||||||
}
|
}
|
||||||
bool CServerInfo::ParseLocation(int *pResult, const char *pString)
|
bool CServerInfo::ParseLocation(int *pResult, const char *pString)
|
||||||
{
|
{
|
||||||
|
|
|
@ -439,7 +439,7 @@ IServerBrowserHttp *CreateServerBrowserHttp(IEngine *pEngine, IConsole *pConsole
|
||||||
const char *apUrls[CChooseMaster::MAX_URLS] = {0};
|
const char *apUrls[CChooseMaster::MAX_URLS] = {0};
|
||||||
const char **ppUrls = apUrls;
|
const char **ppUrls = apUrls;
|
||||||
int NumUrls = 0;
|
int NumUrls = 0;
|
||||||
IOHANDLE File = pStorage->OpenFile("serverlist_urls.cfg", IOFLAG_READ, IStorage::TYPE_ALL);
|
IOHANDLE File = pStorage->OpenFile("ddnet-serverlist-urls.cfg", IOFLAG_READ, IStorage::TYPE_ALL);
|
||||||
if(File)
|
if(File)
|
||||||
{
|
{
|
||||||
CLineReader Lines;
|
CLineReader Lines;
|
||||||
|
|
|
@ -34,10 +34,10 @@ private:
|
||||||
CServerBrowserPingCache::CServerBrowserPingCache(IConsole *pConsole, IStorage *pStorage) :
|
CServerBrowserPingCache::CServerBrowserPingCache(IConsole *pConsole, IStorage *pStorage) :
|
||||||
m_pConsole(pConsole)
|
m_pConsole(pConsole)
|
||||||
{
|
{
|
||||||
m_pDisk = SqliteOpen(pConsole, pStorage, "cache.sqlite3");
|
m_pDisk = SqliteOpen(pConsole, pStorage, "ddnet-cache.sqlite3");
|
||||||
if(!m_pDisk)
|
if(!m_pDisk)
|
||||||
{
|
{
|
||||||
pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "serverbrowse_ping_cache", "failed to open cache.sqlite3");
|
pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "serverbrowse_ping_cache", "failed to open ddnet-cache.sqlite3");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sqlite3 *pSqlite = m_pDisk.get();
|
sqlite3 *pSqlite = m_pDisk.get();
|
||||||
|
|
|
@ -30,7 +30,7 @@ CSqlite SqliteOpen(IConsole *pConsole, IStorage *pStorage, const char *pPath)
|
||||||
char aFullPath[MAX_PATH_LENGTH];
|
char aFullPath[MAX_PATH_LENGTH];
|
||||||
pStorage->GetCompletePath(IStorage::TYPE_SAVE, pPath, aFullPath, sizeof(aFullPath));
|
pStorage->GetCompletePath(IStorage::TYPE_SAVE, pPath, aFullPath, sizeof(aFullPath));
|
||||||
sqlite3 *pSqlite = nullptr;
|
sqlite3 *pSqlite = nullptr;
|
||||||
bool ErrorOpening = SQLITE_HANDLE_ERROR(sqlite3_open(aFullPath, &pSqlite)) != SQLITE_OK;
|
const bool ErrorOpening = SQLITE_HANDLE_ERROR(sqlite3_open(aFullPath, &pSqlite)) != SQLITE_OK;
|
||||||
// Even on error, the database is initialized and needs to be freed.
|
// Even on error, the database is initialized and needs to be freed.
|
||||||
// Except on allocation failure, but then it'll be nullptr which is
|
// Except on allocation failure, but then it'll be nullptr which is
|
||||||
// also fine.
|
// also fine.
|
||||||
|
|
Loading…
Reference in a new issue