K Envanteri ticaret sorunu 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 63

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0


Geçen yeni bir k envanterine geçtim bunun kodlarını silerken fark ettim sorun varmış
envanter doluyken item gitmiyordu para gidiyordu


kaldırırken kısa bir çözüm yazdım pek iyi değil sorguyu iki kere yapıyor ama çözer ;)


K Envanteri Ticaret Sorunu Fix: Metin2 Private Server Geliştirme Rehberi

Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın problemlerden birisi K Envanteri üzerindeki eşyaların ticaret sırasında doğru şekilde işlenememesidir. Bu durum, oyuncuların eşya transferini engeller veya hatalı veri iletmelerine neden olabilir. Bu yazıda, K Envanteri ticaret sorununun temel nedenlerini analiz edip, C++ kaynak kod seviyesinde bir çözüm sunacağız.

Sorun Nedir?
Metin2 oyununda normal envanter 45 slotluk iken, K Envanteri (3. envanter) 45 slotluk ek bir alandır. Ancak bazı özel sunucularda bu envanterin eşyaları doğrudan ticaret ekranına entegre edilmediğinden, oyuncular bu eşyaları doğrudan ticaret yapamazlar. Bu, client src ve game server arasındaki veri senkronizasyonundan kaynaklanır.

Teknik Nedenler
Ticaret sırasında eşya verileri packet olarak gönderilir. Bu paketler, game core tarafından işlenir. Eğer K Envanteri için özel bir kontrol yazılmamışsa, sistem sadece ilk envanteri (0. envanter) dikkate alabilir. Bu da oyuncuların 3. envanterden eşya seçmelerini engeller.

Fix Uygulaması (C++ Kaynak Kodu)
Öncelikle game server tarafında bulunan char_item.cpp dosyasına bakmalısınız. Burada, TradeItemAddPacket fonksiyonu incelenmelidir. Fonksiyon, hangi envanterden veri alındığını belirten bir inventory index parametresi içerir. Bu indeks 2’ye eşitse, yani K Envanteri ise, ekstra kontroller yapılmalıdır.

Ayrıca, client src tarafında uiscript içindeki trade UI dosyasında, K Envanteri slotları için uygun event handler tanımlanmış mı diye kontrol edilmelidir. Eğer eksikse, bu slotlardan gelen veriler trade window ile ilişkilendirilemez.

Python GUI Entegrasyonu
Eğer py root üzerinden bir GUI kullanıyorsanız, trade.py gibi dosyalarda K Envanteri slotları için özel event mapping tanımlamalısınız. Örneğin, slot ID 90-179 aralığı K Envanteri ise, bu slotlardan gelen tıklamalar doğru şekilde handle edilmelidir.

Veritabanı (DB) Bağlantısı
Bazı durumlarda, envanter verileri DB'de farklı tablolarda tutulabilir. Bu tür yapılandırmalarda, auth server ve game server arasında veri tutarlılığı sağlanmalıdır. Özellikle inventory slot numaraları doğru şekilde eşleştirilmelidir.

Martysama Sistemleriyle Entegrasyon
Metin2 özel sunucularında popüler olan Martysama sistemleriyle uyumlu çalışmak için, K Envanteri fix uygulaması, martysama inventory modülünü de desteklemelidir. Bu modül, ek envanter alanlarını dinamik olarak yönetebilir. Source edit işlemleri sırasında bu uyum göz önünde bulundurulmalıdır.

Test Süreci
Fix uygulandıktan sonra, compile işlemi yapılmadan önce tüm dosyaların uyumlu olduğundan emin olunmalıdır. Oyuncularla test ederek, K Envanteri eşyalarının artık ticaret ekranında doğru şekilde görüldüğünü ve taşındığını doğrulayın. PvP sistem ile etkileşimdeyse, eşyanın PvP statları gibi değerlerin de doğru aktarıldığından emin olun.

Sonuç
K Envanteri ticaret sorunu, Metin2 özel sunucularında karşılaşılabilecek küçük ama büyük etkiler doğuran bir problem olabilir. Doğru C++ ve Python ayarlamalarıyla bu sorun çözülebilir. Metin2 server src dosyalarında yapılacak değişikliklerle hem kullanıcı deneyimi artırılır hem de sunucu güvenliği güçlendirilir.


K Inventory Trade Issue Fix: Metin2 Private Server Development Guide

One of the common problems encountered during development on Metin2 private servers is the incorrect handling of items in the K Inventory during trading. This issue can prevent players from transferring items or cause faulty data transmissions. In this article, we will analyze the root causes of the K Inventory trading issue and provide a solution at the C++ source code level.

What Is The Problem?
In the Metin2 game, while the standard inventory has 45 slots, the K Inventory (3rd inventory) provides an additional 45-slot area. However, in some private servers, these items are not directly integrated into the trade screen, preventing players from trading items directly from that inventory. This issue stems from the data synchronization between the client src and the game server.

Technical Causes
During trading, item data is sent as packets. These packets are processed by the game core. If no special check has been written for the K Inventory, the system may only consider the first inventory (0th inventory). This prevents players from selecting items from the third inventory.

Applying the Fix (C++ Source Code)
Firstly, you should look into the char_item.cpp file on the game server side. Here, the TradeItemAddPacket function needs to be examined. The function includes an inventory index parameter that specifies which inventory the data comes from. If this index equals 2, meaning it's the K Inventory, extra checks must be performed.

Additionally, in the uiscript within the client src, ensure that proper event handlers are defined for K Inventory slots in the trade UI file. If missing, data from these slots cannot be associated with the trade window.

Python GUI Integration
If you're using a GUI via py root, define custom event mappings for K Inventory slots in files like trade.py. For instance, if slot IDs range from 90 to 179 for the K Inventory, clicks from these slots must be handled correctly.

Database (DB) Connection
In some cases, inventory data might be stored in different tables in the database. In such configurations, data consistency between the auth server and game server must be ensured. Especially, inventory slot numbers must be correctly matched.

Integration with Martysama Systems
To work compatibly with popular Martysama systems in Metin2 private servers, the K Inventory fix must also support the martysama inventory module. This module can dynamically manage extended inventory areas. Such compatibility must be considered during source edit operations.

Testing Process
After applying the fix, ensure all files are compatible before performing the compile operation. Test with players to confirm that items from the K Inventory now appear correctly in the trade screen and can be transferred. If interacting with PvP systems, verify that item stats such as PvP bonuses are also transferred correctly.

Conclusion
The K Inventory trade issue can be a minor but impactful problem in Metin2 private servers. With proper C++ and Python adjustments, this issue can be resolved. Modifications to Metin2 server src files enhance both user experience and server security.
 

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

Benzer konular

Geri
Üst Alt