MaviAyGames | [C ++] Yang Birikintisi Fix

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 38

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
"Yang bombasını" nasıl kapatacağınızı göstereceğim.



"Yang Bombası" ne iş? Mesele şu ki, kalabalığı öldürdükten sonra yere yangları "serpiyor" ve bu da gecikmeye ve daha büyük benekli bir çöp kutusuna neden oluyor.




Kod:
1. char_battle.cpp giriyoruz ve şunu arıyoruz: else if (1 == number(1, iGold10DropPct))     {         //         // µ· ĆřĹş˝Ä µĺ·Ó         //         for (int i = 0; i < 10; ++i)         {             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;             iGold *= iGoldMultipler;             if (iGold == 0)             {                 continue;             }             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))             {                 pos.x = GetX() + (number(-7, 7) * 20);                 pos.y = GetY() + (number(-7, 7) * 20);                 item->AddToGround(GetMapIndex(), pos);                 item->StartDestroyEvent();                 iTotalGold += iGold; // Total gold             }         }     } 2. Kodu bulduğumuzda yukarıda verilen her şeyi siliyoruz. 3. Dosyayı kaydedip build ediyoruz.



#Ek olarak, Boss'lardanda iptal etmek isterseniz aşağıdaki düzenlemeyi yapınız.
Kod:
service.h Ekle: #define DISABLE_YANG_BOMB char_battle.cpp Arat:     if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)     {         if (1 == number(1, iGold10DropPct))             iGoldMultipler *= 10; // 1% 확률로 돈 10배         int iSplitCount = number(25, 35);         for (int i = 0; i < iSplitCount; ++i)         {             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;             if (test_server)                 sys_log(0, "iGold %d", iGold);             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;             iGold *= iGoldMultipler;             if (iGold == 0)             {                 continue ;             }             if (test_server)             {                 sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);                 sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);             }             // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))             {                 pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);                 pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);                 item->AddToGround(GetMapIndex(), pos);                 item->StartDestroyEvent();                 iTotalGold += iGold; // Total gold             }         }     } Tüm kodu şu şekilde değiştiriyoruz:     if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)     {         if (1 == number(1, iGold10DropPct))             iGoldMultipler *= 10; // 1% Č®·ü·Î µ· 10ąč         int iSplitCount = number(25, 35);         for (int i = 0; i < iSplitCount; ++i)         {             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;             if (test_server)                 sys_log(0, "iGold %d", iGold);             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;             iGold *= iGoldMultipler;             if (iGold == 0)             {                 continue ;             }             if (test_server)             {                 sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);                 sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);             }             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ #ifdef DISABLE_YANG_BOMB             pkAttacker->GiveGold(iGold / iSplitCount);             iTotalGold += iGold; #else             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))             {                 pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);                 pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);                 item->AddToGround(GetMapIndex(), pos);                 item->StartDestroyEvent();                 iTotalGold += iGold; // Total gold             } #endif         }     }     // 1% Č®·ü·Î µ·Ŕ» 10°ł ¶łľî ¶ß¸°´Ů. (10ąč µĺ·ÓŔÓ #ifndef DISABLE_YANG_BOMB     else if (1 == number(1, iGold10DropPct))     {         //         // µ· ĆřĹş˝Ä µĺ·Ó         //         for (int i = 0; i < 10; ++i)         {             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;             iGold *= iGoldMultipler;             if (iGold == 0)             {                 continue;             }             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))             {                 pos.x = GetX() + (number(-7, 7) * 20);                 pos.y = GetY() + (number(-7, 7) * 20);                 item->AddToGround(GetMapIndex(), pos);                 item->StartDestroyEvent();                 iTotalGold += iGold; // Total gold             }         }     } #endif     else     {         //         // ŔĎąÝŔűŔÎ ąć˝ÄŔÇ µ· µĺ·Ó         //         int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);         iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;         iGold *= iGoldMultipler;         int iSplitCount;         if (iGold >= 3 && !LC_IsYMIR())             iSplitCount = number(1, 3);         else if (GetMobRank() >= MOB_RANK_BOSS)         {             iSplitCount = number(3, 10);             if ((iGold / iSplitCount) == 0)                 iSplitCount = 1;         }         else             iSplitCount = 1;         if (iGold != 0)         {             iTotalGold += iGold; // Total gold             for (int i = 0; i < iSplitCount; ++i)             {                 if (isAutoLoot)                 {                     pkAttacker->GiveGold(iGold / iSplitCount);                 }                 else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))                 {                     pos.x = GetX() + (number(-7, 7) * 20);                     pos.y = GetY() + (number(-7, 7) * 20);                     item->AddToGround(GetMapIndex(), pos);                     item->StartDestroyEvent();                 }             }         }     }
Öncesi

39135_d82bb74cacd04786b63790b1262c3722.jpeg

Sonrası
39208_4ed411308eaedc7f9eaa7d217977e977.jpg

MaviAyGames | C++ Yang Birikintisi Fix

Metin2 özel sunucularında karşılaşılan yaygın problemlerden biri Yang Birikintisi sorunudur. Bu sorun genellikle oyun sırasında yang kazançları normal seviyelerin çok üstüne çıktığında ve doğru şekilde işlenmediğinde ortaya çıkar. Bu durum hem oyun deneyimini bozar hem de sunucu ekonomisini ciddi anlamda etkileyebilir. MaviAyGames tarafından geliştirilen bu fix, C++ tabanlı bir çözüm sunarak bu soruna kalıcı bir çıkış yolu sağlar.

Yang Birikintisi Nedir?
Metin2 oyununda oyuncuların para birimi olan 'yang', çeşitli aktivitelerle kazanılır. Özellikle PvP savaşları, canavar öldürme, görev tamamlama gibi eylemler sonucu yang gelirleri artar. Ancak bazı durumlarda, sunucu tarafında yapılan eksik veya hatalı işlemler sebebiyle yang miktarı beklenmedik biçimde artabilir. Bu artışlar kontrol edilemezse, oyuncuların yang birikintileri sınırsızca artabilir ve oyun içi dengeler bozulabilir.

Fix Neden Gerekli?
Sunucu geliştiricileri, oyun içi para dengesini korumak adına bu tür anomali durumları engellemek zorundadır. Yang birikintisi fix, sunucu tarafında C++ seviyesinde yapılan küçük ama kritik değişikliklerle, herhangi bir yang transferi sırasında maksimum limit kontrolü yaparak bu tür hataları önler. Bu sayede hem sunucu ekonomisi korunmuş olur hem de kullanıcı deneyimi olumsuz etkilenmez.

C++ ile Uygulama Yöntemi
Fix, genellikle Metin2 game core dosyalarında bulunan char_battle.cpp veya char_manager.cpp gibi dosyalarda yapılır. Yang transferi yapılan fonksiyonlara özel kontroller eklenerek, her işlemde maksimum yang sınırı kontrol edilir. Örneğin, bir oyuncunun elindeki yang miktarı belirli bir eşik değerini aştığında, fazla miktar sistem tarafından silinir veya loglanır. Bu işlem C++ seviyesinde güvenli ve hızlı bir şekilde yapılır.

Hatalar ve Çözüm Yolları
Yang birikintisi fix uygulanırken karşılaşılabilecek bazı hata senaryoları vardır. Örneğin, yanlışlıkla tüm yang miktarı sıfırlanabilir veya işlem esnasında sunucu çökmesi yaşanabilir. Bu nedenle fix uygulaması sırasında mutlaka yedek alınmalı ve test sunucusunda denemeler yapılmalıdır. Ayrıca, sunucunun versiyonuna göre değişiklik gösterebilecek olan core dosyaları dikkatlice incelenmelidir.

Fix Uygulandıktan Sonra
Fix başarılı bir şekilde uygulandığında, sunucuda yang birikintisi yaşayan karakterlerin sayısı azalır. Oyun içi para dengesi daha istikrarlı hale gelir ve sunucu yöneticileri için ekonomi takibi kolaylaşır. Bu fix, aynı zamanda Metin2 özel sunucularında profesyonel bir yönetim anlayışının da göstergesidir.

Sonuç
Metin2 özel sunucularında güvenlik ve ekonomik denge açısından kritik öneme sahip olan Yang Birikintisi Fix, C++ bilgisi gerektiren ancak uygulaması oldukça faydalı bir sistemdir. MaviAyGames tarafından sağlanan bu fix sayesinde sunucu sahipleri, daha sağlıklı ve uzun ömürlü bir oyun ortamı oluşturabilirler.


MaviAyGames | C++ Yang Overflow Fix

One of the common issues encountered in Metin2 private servers is the Yang Overflow problem. This issue usually occurs when yang gains during the game exceed normal levels and are not processed correctly. This situation can both disrupt the gaming experience and significantly affect the server economy. The fix developed by MaviAyGames offers a permanent solution with a C++ based approach.

What is Yang Overflow?
In the Metin2 game, yang serves as the players currency and is earned through various activities. Yang earnings increase through actions such as PvP battles, monster kills, and quest completions. However, in some cases, incomplete or incorrect processes on the server side can cause yang amounts to rise unexpectedly. If these increases become uncontrollable, player yang accumulation can grow indefinitely, disrupting in-game balances.

Why is the Fix Needed?
Server developers must prevent such anomalies to maintain in-game economic balance. The yang overflow fix prevents such errors by implementing maximum limit checks during any yang transaction via small but critical changes at the C++ level on the server side. This ensures that the server economy remains intact without negatively affecting user experience.

Implementation Method with C++
The fix is generally applied within Metin2 game core files such as char_battle.cpp or char_manager.cpp. Special checks are added to functions handling yang transfers to verify maximum yang limits during each transaction. For example, if a player's yang amount exceeds a certain threshold, the excess is either deleted or logged by the system. This process is done securely and quickly at the C++ level.

Errors and Solutions
There are potential error scenarios when applying the yang overflow fix. For instance, all yang may be accidentally reset, or the server might crash during the process. Therefore, backups should always be taken before applying the fix, and tests should be performed on a test server. Additionally, core files that may vary according to the server version must be carefully examined.

After Applying the Fix
Once the fix is successfully implemented, the number of characters experiencing yang overflow decreases. In-game economic balance becomes more stable, and tracking the economy becomes easier for server administrators. This fix also indicates a professional management approach in Metin2 private servers.

Conclusion
The Yang Overflow Fix, which is critically important for security and economic balance in Metin2 private servers, is a system that requires C++ knowledge but proves highly beneficial. Thanks to this fix provided by MaviAyGames, server owners can create a healthier and longer-lasting gaming environment.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt