MaviAyGames | Ok Çantası Client Crash 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 65

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Ok çantası sistemi eklendiğinde ok olmadan saldırmaya çalışıldığında client kapanıyormuş bu şekilde fixleyebilirsiniz.

Kod:
bool CPythonPlayer::__HasEnoughArrow()

Kod bloğunu değiştir:
Kod:
bool CPythonPlayer::__HasEnoughArrow() {     CItemData * pItemData;     if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))     if (CItemData::ITEM_TYPE_WEAPON == pItemData->GetType()) #ifdef ENABLE_NEW_ARROW_SYSTEM     if (CItemData::WEAPON_ARROW || CItemData::WEAPON_UNLIMITED_ARROW == pItemData->GetSubType())     {         return true;     } #endif     PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotShotError", Py_BuildValue("(is)", GetMainCharacterIndex(), "EMPTY_ARROW"));     return false; } }

MaviAyGames | Ok Çantası Client Crash Fix

Metin2 özel sunucularında yaşanan client crash sorunları, genellikle hatalı sistem entegrasyonları veya eksik kontrol mekanizmaları nedeniyle oluşur. Bu yazıda MaviAyGames tarafından geliştirilen 'Ok Çantası' sistemi ile ilgili olarak karşılaşılan client crash hatasının çözümünü ele alacağız. Bu sistem, Metin2 özel sunucu geliştiricileri arasında popüler olan bir C++ tabanlı sistemdir ve doğru entegre edilmediğinde istemci tarafında çökmelere sebep olabilir.

Sorunun Temeli
Ok Çantası sistemi, oyuncuların farklı ok türlerini hızlıca seçip kullanabilmesini sağlar. Ancak, sistem hatalı kodlama veya eksik veri kontrolü durumunda, istemci tarafında stack overflow ya da null pointer gibi hatalar tetiklenebilir. Bu da doğrudan client çökmesine yol açar. Özellikle Martysama tabanlı client'lerde bu sorun daha sık rastlanmaktadır.

Teknik Açıklama
Client-side sistemlerde, özellikle uiscript veya py root dosyalarında yapılan küçük eksiklikler, büyük sorunlara neden olabilir. Ok Çantası sistemi, genellikle Python GUI üzerinden çalışır ve item_slot_type gibi veri tipleri üzerinden işlem yapar. Eğer bu veriler kontrolsüz şekilde istemciye gönderilirse, hata oluşur.

Fix Uygulaması
1. Öncelikle client/src/userinterface/ dizininde yer alan uitooltip.py dosyasında ok çantası ile ilgili fonksiyonların kontrol edilmesi gerekir. Özellikle OnUpdate() fonksiyonunun içinde yapılan item slot kontrolü, None kontrolü yapılmadan çağrılırsa çökme meydana gelir.
2. game/core/src/game/item.cpp dosyasında, ITEM_ANTIFLAG_FIGHTER gibi bayrak kontrolleri eksikse, bazı item'lar için sistem hatalı davranabilir. Bu da client tarafında beklenmedik çökmelere neden olur.
3. Ayrıca, db core ile eşleşmeyen item ID'lerinin gönderilmesi de hata riskini artırır. Bu nedenle game/db dosyalarında tanımlı olan item listeleri ile client tarafındaki tanımın birebir aynı olması gerekir.

Önerilen Çözüm[/CR]
Client tarafında try-except blokları ile olası hatalar engellenmelidir. Örneğin:
if item_slot and item_slot != None:
# Normal işlem
else:
return

Sonuç
MaviAyGames tabanlı Ok Çantası sisteminin güvenli çalışması için hem client hem de server tarafında eksiksiz ve doğru kodlama yapılmalıdır. Bu tip sistemlerde source edit işlemleri dikkatle yapılmalı ve test edilmelidir. Metin2 Lobby olarak, bu tür sistemlerin doğru entegrasyonu için sürekli güncel kaynaklar sunuyoruz.


MaviAyGames | Arrow Bag Client Crash Fix

Client crashes in Metin2 private servers often occur due to incorrect system integration or missing validation mechanisms. In this article, we will address the solution for the client crash issue related to the 'Arrow Bag' system developed by MaviAyGames. This system is a popular C++-based feature among Metin2 private server developers, and improper integration can cause crashes on the client side.

Root of the Problem
The Arrow Bag system allows players to quickly select and use different types of arrows. However, if the system is coded incorrectly or lacks proper data validation, errors such as stack overflow or null pointer can be triggered on the client side, leading directly to a crash. This issue occurs more frequently in Martysama-based clients.

Technical Explanation
In client-side systems, minor mistakes in files like uiscript or py root can lead to major issues. The Arrow Bag system typically operates through Python GUI and handles operations via data types such as item_slot_type. If these values are sent to the client without proper checks, errors can occur.

Applying the Fix
1. Firstly, check functions related to the arrow bag in the uitooltip.py file located under client/src/userinterface/. Specifically, the item slot check inside the OnUpdate() function may trigger a crash if called without checking for None.
2. In game/core/src/game/item.cpp, missing flag checks like ITEM_ANTIFLAG_FIGHTER might cause unexpected behavior for certain items, resulting in crashes on the client side.
3. Additionally, sending item IDs that do not match the db core definitions increases the risk of errors. Therefore, the item lists defined in game/db files must exactly match those on the client side.

Suggested Solution
Try-except blocks should be used on the client side to prevent potential errors. For example:
if item_slot and item_slot != None:
# Normal process
else:
return

Conclusion
To ensure safe operation of the Arrow Bag system based on MaviAyGames, complete and correct coding is essential on both client and server sides. Such systems require careful source edit implementations and thorough testing. As Metin2 Lobby, we continuously provide updated resources for the correct integration of such systems.
 

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

Benzer konular

Geri
Üst Alt