Scarlet 1
Scarlet
Bvural41 1
Bvural41
mavzermete 1
mavzermete
Fethi Polat 1
Fethi Polat
Hikaye Ekle

MaviAyGames | item_award.sql Güncelleştirme

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

Service.h
Ekle:
Kod:
#define ENABLE_ITEMAWARD_REFRESH

Arat:
Kod:
        if (!(thecore_heart->pulse % (thecore_heart->passes_per_sec * 10)))

Üstüne ekle:
Kod:
#ifdef ENABLE_ITEMAWARD_REFRESH
        if (!(thecore_heart->pulse % (thecore_heart->passes_per_sec * 5)))
        {
            ItemAwardManager::instance().RequestLoad();
        }
#endif

*Güncelleme*
C++:
#ifdef ENABLE_ITEMAWARD_REFRESH

static uint32_t s_lastItemAwardRefreshPulse = 0;

#ifdef ENABLE_TEST_SERVER
const uint32_t refreshInterval = thecore_heart->passes_per_sec * 5; // Test sunucusu için 5 saniye
#else
const uint32_t refreshInterval = thecore_heart->passes_per_sec * 15; // Aktif sunucu için 15 saniye
#endif

if (thecore_heart->pulse - s_lastItemAwardRefreshPulse >= refreshInterval)
{
    if (ItemAwardManager::instance().IsConnected())
    {
        ItemAwardManager::instance().RequestLoad();
        s_lastItemAwardRefreshPulse = thecore_heart->pulse;
        sys_log(0, "ItemAward tablosu yenilendi (pulse: %u).", thecore_heart->pulse);
    }
    else
    {
        sys_err("ItemAwardManager bağlantısı yok. Veritabanı kontrolü atlandı.");
    }
}

#endif

*Yapılanlar:*

- Pulse döngüsüne `ItemAwardManager::RequestLoad()` fonksiyonu, 15 saniyede bir (testte 5 sn) çağrılacak şekilde kod eklendi.

- Bağlantı kontrolü yapıldı, bağlantı yoksa sorgu atılmıyor.

- Loglama eklendi, yenileme ve hata durumları kayıt altına alınıyor.



C++:
[INFO] ItemAward tablosu yenilendi (pulse: 123456).
[ERROR] ItemAwardManager bağlantısı yok. Veritabanı kontrolü atlandı.
 
Son düzenleme:
Güncelleme verildi.

*Yapılanlar:*

- Pulse döngüsüne `ItemAwardManager::RequestLoad()` fonksiyonu, 15 saniyede bir (testte 5 sn) çağrılacak şekilde kod eklendi.

- Bağlantı kontrolü yapıldı, bağlantı yoksa sorgu atılmıyor.

- Loglama eklendi, yenileme ve hata durumları kayıt altına alınıyor.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst