Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!
tek sorun kapattığında haritadan kimseyi ışınlamaz ekstra IsGm eklenebilir gmler gidebilir
sorun mutek sorun kapattığında haritadan kimseyi ışınlamaz ekstra IsGm eklenebilir gmler gidebilir
zaten olayı haritaya kimseyi ışınlamaması sistemin bir sorunu yok hocam sıkıntısız çalışıyor ışınlanma yüzüğü ile de test edebilirsiniz ben bizzat denedim.
C++:
Aktif sunucuda gereksiz yük oluşturur.
Performans düşüklüğüne sebep olur.
Cache olarak kullanılabilir.
std::unordered_map<long, bool> g_mapAccessCache;
bool CHARACTER::IsMapAccessAllowed(long lMapIndex)
{
auto it = g_mapAccessCache.find(lMapIndex);
if (it != g_mapAccessCache.end())
return it->second;
char query[256];
snprintf(query, sizeof(query), "SELECT access_enabled FROM map_access_control WHERE map_index = %ld", lMapIndex);
std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(query));
bool result = true;
if (msg->Get()->uiNumRows > 0)
{
MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult);
result = row && row[0] && atoi(row[0]) != 0;
}
g_mapAccessCache[lMapIndex] = result;
return result;
}
konuya dahil ettim teşekkürlerC++:Aktif sunucuda gereksiz yük oluşturur. Performans düşüklüğüne sebep olur. Cache olarak kullanılabilir. std::unordered_map<long, bool> g_mapAccessCache; bool CHARACTER::IsMapAccessAllowed(long lMapIndex) { auto it = g_mapAccessCache.find(lMapIndex); if (it != g_mapAccessCache.end()) return it->second; char query[256]; snprintf(query, sizeof(query), "SELECT access_enabled FROM map_access_control WHERE map_index = %ld", lMapIndex); std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(query)); bool result = true; if (msg->Get()->uiNumRows > 0) { MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult); result = row && row[0] && atoi(row[0]) != 0; } g_mapAccessCache[lMapIndex] = result; return result; }
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 8
- Görüntüleme
- 330
- Cevaplar
- 0
- Görüntüleme
- 290
- Cevaplar
- 11
- Görüntüleme
- 760
- Cevaplar
- 9
- Görüntüleme
- 483