Simya envanteri doluluk kontrolü

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Sandık açarken simyaların yere düşmemesi için bunu yaptım isteyen eklesin.

197384_b604f05d664725e1cc800d71fe740a27.png


Kod:
//Arat; void CHARACTER::CopyDragonSoulItemGrid(std::vector<WORD>& vDragonSoulItemGrid) const //Üstüne ekle; int CHARACTER::GetEmptyDragonSoulInventoryType() const {     auto bSize = 1;     bool foundEmptySlot = false; // Boş yer bulunup bulunmadığını kontrol etmek için flag     for (auto i = 0; i < DS_SLOT_MAX; ++i)     {         for (auto j = 0; j < DRAGON_SOUL_GRADE_MAX; ++j)         {             WORD wBaseCell = i * DRAGON_SOUL_STEP_MAX * DRAGON_SOUL_BOX_SIZE + j * DRAGON_SOUL_BOX_SIZE;             if (WORD_MAX == wBaseCell)                 return -1;             foundEmptySlot = false;             for (auto k = 0; k < DRAGON_SOUL_BOX_SIZE; ++k)             {                 if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, k + wBaseCell), bSize))                 {                     foundEmptySlot = true;                     break;                 }             }             if (!foundEmptySlot)             {                 return i * 10 + j;             }         }     }     return 0; } //Arat;(case ITEM_GIFTBOX: içerisinde)                 DWORD dwBoxVnum = item->GetVnum(); //Altına ekle;                 if((dwBoxVnum > 51500 && dwBoxVnum < 52000) || (dwBoxVnum >= 50255 && dwBoxVnum <= 50260))                 {                     auto DragonSoulInventoryCheck = GetEmptyDragonSoulInventoryType();                     if (DragonSoulInventoryCheck != 0)                     {                         auto DragonSoulGradeTypes = DragonSoulInventoryCheck / 10;                         auto DragonSoulStepTypes = DragonSoulInventoryCheck % 10;                         if (DragonSoulStepTypes == -1)                         {                             return false;                         }                         std::string col_type = "";                         std::string row_type = "";                         if (DragonSoulGradeTypes == 0)                             col_type = "Elmas";                         else if (DragonSoulGradeTypes == 1)                             col_type = "Yakut";                         else if (DragonSoulGradeTypes == 2)                             col_type = "Yeşim";                         else if (DragonSoulGradeTypes == 3)                             col_type = "Safir";                         else if (DragonSoulGradeTypes == 4)                             col_type = "Grena";                         else if (DragonSoulGradeTypes == 5)                             col_type = "Oniks";                         if (DragonSoulStepTypes == 0)                             row_type = "İşlenmemiş";                         else if (DragonSoulStepTypes == 1)                             row_type = "Yontulmuş";                         else if (DragonSoulStepTypes == 2)                             row_type = "Ender";                         else if (DragonSoulStepTypes == 3)                             row_type = "Antika";                         else if (DragonSoulStepTypes == 4)                             row_type = "Efsanevi";                         ChatPacket(CHAT_TYPE_INFO, "%s simyasının %s envanteri dolu.!", col_type.c_str(), row_type.c_str());                         return false;                     }                 }

Simya Envanteri Doluluk Kontrolü Nedir?
Metin2 özel sunucularında simya sistemi, oyuncuların item'ları dönüştürmesine olanak tanır. Bu sistemde kullanılan 'simya envanteri', belirli bir kapasiteye sahiptir. Simya envanteri doluluk kontrolü ise, bu kapasitenin dolup dolmadığını kontrol eden bir mekanizmadır. Bu kontrol sayesinde oyuncu, envanteri dolu iken simya yapmaya çalıştığında sistem onu uyarabilir veya işlemi engelleyebilir.

Simya Sisteminin Önemi
Simya, Metin2'de item güçlendirme, dönüştürme ve yeniden oluşturma işlemleri için kritik bir rol oynar. Özellikle PvP sunucularında simya ile elde edilen güçlü item'lar, savaşlarda büyük avantaj sağlar. Ancak simya işlemi sırasında envanterde yeterli boşluk olmazsa, işlem başarısız olabilir ya da beklenmedik sonuçlar doğabilir. Bu yüzden simya envanteri doluluk kontrolü, sistemin doğru çalışması için gerekli bir özelliktir.

Simya Envanteri Doluluk Kontrolü Nasıl Çalışır?
Bu kontrol genellikle C++ tabanlı sunucu kaynak kodlarında yer alır. Oyuncu simya işlemi başlatmak istediğinde, önce simya envanterinde yeterli boşluk olup olmadığı kontrol edilir. Gerekli kontroller yapılmazsa, envanter dolu iken yapılan simya sonucunda item'lar kaybolabilir veya oyuncunun envanterinde beklenmedik yerlerde ortaya çıkabilir. Bu nedenle geliştiriciler, simya sistemine özel olarak bir 'envanter doluluk kontrolü' fonksiyonu eklemelidir.

Python GUI ve Uiscript Kullanımı
Metin2 özel sunucularında simya envanteri kontrolü, hem sunucu tarafında hem de istemci tarafında uygulanabilir. Python GUI ve Uiscript gibi sistemlerle, simya arayüzüne doğrudan envanter durumu entegre edilebilir. Böylece oyuncu, simya yapmadan önce hangi slotların dolu olduğunu görebilir. Bu tür arayüz geliştirmeleri, kullanıcı deneyimini ciddi anlamda artırır.

DB ve Game Sunucu Entegrasyonu
Simya envanteri doluluk kontrolü, DB sunucusuyla da ilişkilidir. Oyuncunun envanter verisi DB'de tutulduğu için, sunucu tarafında yapılacak kontroller DB ile senkron çalışmalıdır. Bu senkronizasyon eksik olursa, simya işlemi sırasında veri kaybı veya çakışmalar yaşanabilir. Bu nedenle DB core ve game core arasında güçlü bir koordinasyon sağlanmalıdır.

Geliştiriciler İçin Öneriler
Simya sistemi üzerinde çalışan geliştiriciler, simya envanteri doluluk kontrolünü manuel olarak eklemelidir. Bu işlem sırasında C++ bilgisi oldukça önemlidir. Kaynak kodlara müdahale etmeden önce mutlaka yedek alınmalı ve test ortamında denenebilir. Ayrıca simya sistemini düzenli olarak test eden otomatik sistemler kurmak, uzun vadede hata riskini azaltır. Bu konuda MARTYSAMA gibi gelişmiş kaynaklar incelenebilir.

Sonuç
Simya envanteri doluluk kontrolü, Metin2 özel sunucularında kullanıcı dostu ve güvenli bir simya sistemi kurmak için kritik öneme sahiptir. Doğru uygulandığında hem kullanıcılar hem de geliştiriciler için faydalı olur. Bu tür sistemsel kontroller, Metin2 geliştirme sürecinde göz ardı edilmemelidir.


What is Alchemy Inventory Fullness Check?
In Metin2 private servers, the alchemy system allows players to transform items. The 'alchemy inventory' used in this system has a certain capacity. Alchemy inventory fullness check is a mechanism that controls whether this capacity is full or not. Thanks to this check, when the player tries to perform alchemy while the inventory is full, the system can warn them or block the action.

Importance of the Alchemy System
Alchemy plays a critical role in Metin2 for strengthening, transforming, and recreating items. Especially in PvP servers, powerful items obtained through alchemy provide significant advantages during battles. However, if there isn't enough space in the inventory during an alchemy process, the operation may fail or produce unexpected outcomes. Therefore, alchemy inventory fullness check is essential for proper functioning of the system.

How Does Alchemy Inventory Fullness Check Work?
This check usually exists within C++ based server source codes. When a player attempts to start an alchemy process, the system first checks whether there is sufficient free space in the alchemy inventory. If these checks are not implemented, items might disappear or unexpectedly appear in other parts of the player's inventory when the inventory is full during alchemy. Therefore, developers should add a specific 'inventory fullness check' function to the alchemy system.

Usage of Python GUI and Uiscript
In Metin2 private servers, alchemy inventory fullness check can be implemented on both the server side and the client side. With systems like Python GUI and Uiscript, inventory status can be integrated directly into the alchemy interface. This way, the player can see which slots are occupied before performing alchemy. Such UI enhancements significantly improve user experience.

DB and Game Server Integration
The alchemy inventory fullness check is also related to the DB server. Since the player's inventory data is stored in the DB, the checks performed on the server side must work in sync with the DB. If this synchronization is missing, data loss or conflicts might occur during alchemy processes. For this reason, strong coordination between the DB core and the game core must be established.

Recommendations for Developers
Developers working on the alchemy system should manually implement the alchemy inventory fullness check. During this process, knowledge of C++ is crucial. Before making any changes to the source code, backups must be taken and tested in a test environment. Additionally, setting up automated testing systems for the alchemy system regularly reduces error risks in the long term. Advanced resources like MARTYSAMA can be consulted for this purpose.

Conclusion
Alchemy inventory fullness check is critically important for establishing a user-friendly and secure alchemy system in Metin2 private servers. When correctly implemented, it benefits both users and developers. Such systematic checks should not be overlooked during the Metin2 development process.
 

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

Benzer konular

Geri
Üst Alt