Fix Martysama Horse GetLevel

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Hi, anyone who has ever worked on martysama and made a "Hard" server knows that a totally weird bug occurs, namely that we can hit from a horse at level 1.

Merhaba, martysama üzerinde çalışmış ve "Zor" bir sunucu yapmış olan herkes, tamamen garip bir hatanın meydana geldiğini bilir, yani seviye 1'de bir attan vurabiliyoruz.

Fix instancebase.cpp:
Kod:
// Fix by Muchomor 2023 UINT CInstanceBase::SHORSE::GetLevel() {     if (m_pkActor)     {         DWORD dwMountVnum = m_pkActor->GetRace();                  if (dwMountVnum == 20101 || dwMountVnum == 20102 || dwMountVnum == 20103)         {             return MOUNT_TYPE_NONE;         } #ifdef ENABLE_NO_MOUNT_CHECK         return MOUNT_TYPE_MILITARY; #else         return static_cast<UINT>(GetMountLevelByVnum(dwMountVnum, false)); #endif     }     return 0; }

Metin2 Özel Sunucu Geliştirme Rehberi: Fix Martysama Horse GetLevel Sistemi

Metin2 Lobby olarak, özel sunucular üzerinde çalışan geliştiricilerin sıkça karşılaştığı hataları ve çözümleri paylaşmaya devam ediyoruz. Bu makalemizde, Martysama temalı Metin2 özel sunucularında yaygın olarak kullanılan Horse GetLevel sisteminin düzeltmesiyle ilgileneceğiz. Özellikle C++ tabanlı game server üzerinde çalışan bu sistemde, at seviyesi alma fonksiyonunun doğru çalışmadığı durumlarla karşılaşabilirsiniz. Bu sorunu çözmek için GetLevel fonksiyonunda bazı değişiklikler yapmanız gerekir.

Sorun Nedir?

Martysama temalı Metin2 server src üzerinde çalışırken, oyuncuların attıklarının seviyesini alamadığınız bir durum söz konusu olabilir. Bu, hem client hem de server tarafında tanımlanan horse yapılarının uyumsuzluğundan veya GetLevel() metodunun doğru şekilde çağrılmamasından kaynaklanabilir. Özellikle Python tabanlı arayüzlerde (örneğin PyGUI) bu bilgi eksik veya hatalı görünebilir.

Fix Uygulama Adımları

1. Game Server dosyalarınızda char_horse.cpp veya benzeri bir dosyayı açın.
2. GetHorseLevel() fonksiyonunu bulun.
3. Fonksiyonun dönen değerin int türünde olduğundan ve player_data->horse.level gibi bir yapıdan çekildiğinden emin olun.
4. Eğer return değeri eksikse veya farklı bir türdeyse, bunu düzeltin.

C++ Kod Örneği:

Kod:
[B]int[/B] CHARACTER::GetHorseLevel() [B]const[/B] {[BR][/BR]    [B]if[/B] ([B]!m_pkHorseInfo[/B]) {[BR][/BR]        [B]return 0[/B];[BR][/BR]    }[BR][/BR]    [B]return m_pkHorseInfo->level[/B];[BR][/BR]}


Not: Bu fonksiyon, martysama horse system dosyalarında farklı isimlerle tanımlanmış olabilir. Dosya adlarını ve metod isimlerini kontrol edin.

Uygulama Sonrası Kontrol

Metin2 client tarafında uiscript üzerinden horse bilgilerini gösteren Python dosyalarında, bu değeri almak için net.SendChatPacket veya benzeri fonksiyonlar üzerinden server ile haberleşmeniz gerekir. PyRoot klasörlerindeki dosyalarda GetHorseLevel() çağrısının doğru yapıldığından emin olun. Bu, pack ve unpack işlemleri sırasında da desteklenmelidir.

Sonuç

Metin2 özel sunucu geliştirme sürecinde, küçük ama önemli hatalar büyük sorunlara neden olabilir. Fix Martysama Horse GetLevel sistemi gibi çözümler, PvP sunucularında daha stabil bir deneyim sunar. Server src, auth, game core, db core gibi yapıların birbiriyle uyumlu çalışması, Metin2 Lobby topluluğunun gelişimi için kritik öneme sahiptir.


Metin2 Private Server Development Guide: Fix Martysama Horse GetLevel System

Metin2 Lobby continues to share common errors and solutions encountered by developers working on private servers. In this article, we will address the fix for the Horse GetLevel system commonly used in Martysama-themed Metin2 private servers. Especially in C++-based game servers, you may encounter issues where the horse level function does not work correctly. To resolve this issue, certain modifications need to be made in the GetLevel function.

What is the Problem?

When working with Martysama-themed Metin2 server src, you might face a situation where players' horse levels are not retrieved properly. This can stem from mismatched horse structures defined on both the client and server sides, or from incorrect usage of the GetLevel() method. Particularly in Python-based interfaces (e.g., PyGUI), this information may appear missing or incorrect.

Steps to Apply the Fix

1. Open your game server file such as char_horse.cpp.
2. Locate the GetHorseLevel() function.
3. Ensure that the returned value is of type int and is fetched from a structure like player_data->horse.level.
4. If the return value is missing or of a different type, correct it.

C++ Code Example:

Kod:
[B]int[/B] CHARACTER::GetHorseLevel() [B]const[/B] {[BR][/BR]    [B]if[/B] ([B]!m_pkHorseInfo[/B]) {[BR][/BR]        [B]return 0[/B];[BR][/BR]    }[BR][/BR]    [B]return m_pkHorseInfo->level[/B];[BR][/BR]}


Note: This function may be named differently in Martysama horse system files. Check the file names and method names carefully.

Post-Implementation Verification

On the Metin2 client side, in Python files that display horse information via uiscript, ensure communication with the server is handled via functions like net.SendChatPacket. Make sure GetHorseLevel() calls are properly executed in files within the PyRoot folder. This must also be supported during pack and unpack operations.

Conclusion

In the process of developing Metin2 private servers, small but critical errors can lead to major issues. Solutions like Fix Martysama Horse GetLevel system provide a more stable experience on PvP servers. Compatibility between structures like server src, auth, game core, and db core is critically important for the growth of the Metin2 Lobby community.
 

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

Benzer konular

Geri
Üst Alt