[C++] Frozen files kilitli item ve ok kadim efsun basma fixi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Genç kahraman silahları 70lv olanlar, gelinlik, smokin ve buket fixi eklendi

cmd.general.cpp açılır

arat:
Kod:
ACMD(do_add_new_attribute) . . . if (!item) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_CANNOT_FIND_ITEM")); return; }

Altına ekle:
Kod:
// FK fix     if (item->GetSubType() == WEAPON_UNLIMITED_ARROW)     {         ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Oklara efsun ekleyemezsiniz."));         return;     }     if (item->GetSubType() == WEAPON_ARROW)     {         ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Oklara efsun ekleyemezsiniz."));         return;     }     if (item->IsBind())     {         ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This item is already binded."));         return;     }     if (item->GetVnum() == 50201 || item->GetVnum() == 50202 || item->GetVnum() == 11901 || item->GetVnum() == 11902 || item->GetVnum() == 11903 || item->GetVnum() == 11904 || item->GetVnum() == 11911 || item->GetVnum() == 11912 || item->GetVnum() == 11913 || item->GetVnum() == 11914)     {     ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Buket, gelinlik ve smokinlerde kadim efsun kullanilamaz!"));     return;     }     if (item->GetVnum()== 21970 || item->GetVnum() == 21971 || item->GetVnum() == 21972 || item->GetVnum() == 21973 || item->GetVnum() == 21974 || item->GetVnum() == 21975 || item->GetVnum() == 21976) // genç kahraman silahları 70 level     {     ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Bu silah efsunlanamaz!"));     return;     } // FK fix


Kanıt:

giphy.gif

Metin2 C++ Sistemleri Serisi: Frozen Files ile Kilitli Item ve Ok/Kadim Efsun Basma Fixi

Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın sorunlardan birisi, client-side olarak dondurulmuş (frozen) dosyaların değiştirilmesine rağmen istemcinin eski verileri kullanmaya devam etmesidir. Bu durum özellikle item ve efsun sistemleri üzerinde çalışırken büyük sorunlara yol açabilir. Bu yazıda, frozen files nedeniyle kilitli itemlarda ve ok/kadim efsunlama işlemlerinde yaşanan hataları nasıl düzelteceğimizi ele alacağız.

Frozen Files Nedir?
Frozen files, Metin2 client tarafında bulunan bazı temel yapıları, örneğin item listesi, efsun verileri, GUI yapıları gibi dosyaların doğrudan client üzerinde sabitlenmiş (dondurulmuş) halde bulunmasıdır. Bu dosyalar genellikle root dizininde yer alır ve client başlatıldığında doğrudan yüklenir. Bu nedenle, server-side üzerinde yapılan değişiklikler bazen client tarafından algılanmayabilir.

Kilitli Item Sorunu
Bazı itemlar, client tarafında belirli koşullara göre kilitlenebilir. Örneğin, bir itemin efsunlanmaması gerektiği veya belirli seviye altındaki karakterlerin kullanamaması gibi durumlar söz konusu olabilir. Ancak frozen files nedeniyle bu engeller bypass edilebilir ve kilitli itemlar hala kullanılmaya devam edebilir. Bu da sunucu dengesini bozabilecek güvenlik açıklarına neden olur.

Ok ve Kadim Efsunlama Hataları
Metin2'de ok ve kadim efsunlama işlemleri, client-server senkronizasyonuna dayanır. Eğer client tarafında efsun listesi doğru güncellenmezse, bazı itemlara efsun basılamaz ya da hatalı efsunlar uygulanabilir. Özellikle frozen files üzerinden çalışan clientlerde, bu tür hatalar sıkça görülmektedir. Örneğin, kadim efsunlama sırasında itemin uygunluğu kontrol edilmeyebilir ve hatalı sonuçlar alınabilir.

Fix Stratejisi ve Uygulama Yöntemi
Bu tür hataları çözmek için birkaç farklı yöntem kullanılabilir:

1. Client-side frozen dosyalarının güncellenmesi: Client tarafında yer alan item_proto.ism, locale.ism gibi frozen dosyaların sunucudaki yeni versiyonuyla senkronize edilmesi gerekir. Bu işlem manuel olarak yapılabilir veya update mekanizması ile otomatikleştirilebilir.

2. Server-side item ve efsun kontrollerinin güçlendirilmesi: Sunucu tarafında item kullanım kontrolü ve efsunlama algoritmaları daha sert hale getirilmelidir. Örneğin, kilitli bir itemin kullanılmaya çalışılması durumunda server bu işlemi reddetmelidir.

3. Client-server checksum uygulaması: Client başlatıldığında frozen dosyaların checksum'ları server ile karşılaştırılmalı ve farklılık varsa client güncellemeye yönlendirilmelidir.

C++ Kaynak Kod Örnekleri
Aşağıda, item kilit kontrolünü sunucu tarafında gerçekleştiren basit bir örnek fonksiyon verilmiştir:

int CheckItemLockStatus(DWORD item_vnum) {
if (IsItemLocked(item_vnum)) return false;
return true;
}

Bu fonksiyon, item_vnum'a göre itemin kilitli olup olmadığını kontrol eder. Eğer item kilitliyse, client tarafından yapılan işlem reddedilir.

Sonuç
Frozen files ile ilgili problemler, Metin2 özel sunucu geliştiricileri için önemli bir konudur. Özellikle item ve efsunlama sistemlerinde yaşanan hatalar, oyuncu deneyimini ve sunucu güvenliğini doğrudan etkiler. Doğru strateji ve kodlama ile bu sorunlar başarıyla çözülebilir. Daha fazla C++ tabanlı Metin2 geliştirme içeriği için Metin2Lobby'yi takip etmeye devam edin.


Metin2 C++ Systems Series: Fix for Locked Items and Arrow/Mythical Enchant Issues with Frozen Files

When developing on Metin2 private servers, one of the common issues encountered is that even after modifying frozen files on the client side, the client may continue to use the old data. This situation can cause major problems especially when working on item and enchantment systems. In this article, we will address how to fix errors related to locked items and arrow/mythical enchantments caused by frozen files.

What Are Frozen Files?
Frozen files refer to certain fundamental structures such as item lists, enchantment data, and GUI components which are fixed within the Metin2 client. These files typically reside in the root directory and are loaded directly upon launching the client. Therefore, modifications made on the server-side might not be recognized by the client.

Locked Item Issue
Some items can be locked on the client-side under specific conditions. For instance, an item might be restricted from enchanting or unusable by characters below a certain level. However, due to frozen files, these restrictions might be bypassed and locked items could still be used, leading to security vulnerabilities that can disrupt server balance.

Arrow and Mythical Enchantment Errors
Arrow and mythical enchantment operations in Metin2 rely on client-server synchronization. If the enchantment list is not properly updated on the client-side, some items cannot be enchanted or incorrect enchantments may be applied. Especially in clients running frozen files, such errors frequently occur. For example, during mythical enchanting, the compatibility of an item might not be checked, resulting in erroneous outcomes.

Fix Strategy and Implementation Methods
To resolve these kinds of errors, several methods can be applied:

1. Updating client-side frozen files: The frozen files like item_proto.ism, locale.ism located on the client-side must be synchronized with the new version on the server. This can be done manually or automated via an update mechanism.

2. Strengthening server-side item and enchant checks: Server-side algorithms for item usage and enchanting should be made stricter. For example, if a locked item is attempted to be used, the server must reject the action.

3. Implementing client-server checksum: Upon client launch, the checksums of frozen files should be compared with those on the server, and if any discrepancy is found, the client should be redirected to update.

C++ Source Code Examples
Below is a simple function example that checks item lock status on the server-side:

int CheckItemLockStatus(DWORD item_vnum) {
if (IsItemLocked(item_vnum)) return false;
return true;
}

This function checks whether an item is locked based on its item_vnum. If the item is locked, the operation initiated by the client is rejected.

Conclusion
Issues related to frozen files are significant for Metin2 private server developers. Particularly, errors in item and enchantment systems directly affect player experience and server security. With the correct strategy and coding, these issues can be successfully resolved. For more C++ based Metin2 development content, keep following Metin2Lobby.
 

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

Benzer konular

Geri
Üst Alt