Belli bir dereceden sonra derece kasmayı engelleme

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
adlı arkadaş skype üzerinden sormuştu, daha önce paylaşıldımı bilmiyorum, paylaşıldıysa konu kapatılabilir


Metin2 Sunucularında Belli Bir Dereceden Sonra Derece Kasmanın Engellenmesi

Metin2 özel sunucuları geliştirirken, oyuncuların belirli seviyelerden sonra daha fazla EXP kazanmasını veya level atlamasını engellemek isteyebilirsiniz. Bu durum genellikle sunucu dengesi, PvP odaklı oyun yapısı veya özel etkinlikler nedeniyle yapılır. Bu makalede, belli bir dereceden sonra derece kasmayı engelleme konusunu detaylı olarak ele alacağız. Bu işlem genellikle C++ sunucu kaynak kodlarında düzenlenerek sağlanır.

Neden Belirli Bir Level'de Durdurulmalı?
Oyun içi dengeyi korumak için bazı özel sunucularda maksimum seviye sınırlaması getirmek mantıklıdır. Örneğin, 120. seviyeye kadar izin verilir ama daha sonrası engellenir. Böylece yeni oyuncuların yetişmesi, dengeli bir PvP ortamı ve oyun içi item dengesi korunabilir. Bu tür ayarlamalar özellikle PvP sistemlerinde çok önemlidir.

C++ Sunucu Kaynak Kodlarında Ayarlama
Metin2 sunucu yazılımı genellikle C++ dilinde yazılmıştır. Bu nedenle, game ve auth servislerindeki kaynak kodlar üzerinde değişiklik yapmak gerekir. Oyuncunun EXP kazanmasıyla ilgili fonksiyonlar genellikle char.cpp veya benzeri dosyalarda yer alır. Burada, oyuncunun mevcut seviyesi kontrol edilir ve belirlenen seviyeye ulaşıldığında EXP kazancı sıfırlanabilir veya bir uyarı gönderilir.

Örnek olarak, oyuncu 120. levele ulaştığında EXP alımını engelleyen bir koşul bloğu yazılabilir:

Kod:
if (ch->GetLevel() >= 120)[BR][/BR]{[BR][/BR]    ch->ChatPacket(CHAT_TYPE_INFO, 'Maximum level reached. EXP gain stopped.');[BR][/BR]    return;[BR][/BR]}


Python Tarafında GUI ile Kontrol
Bazı sunucu yapıları, Python tabanlı yönetim sistemleri ile çalışır. Bu durumda, py root ve uiscript gibi yapılar üzerinden de level sınırlaması yapılabilir. Python tarafında bir GUI arayüzü ile sunucu yöneticisi, seviye limitlerini kolayca değiştirebilir. Bu tür sistemler genellikle Martysama tarzı araçlarla entegre edilir ve admin paneli üzerinden yönetilir.

Veritabanı Seviye Kontrolleri
Sunucu veritabanında (genellikle MySQL), karakterlerin seviyeleri player tablosunda tutulur. Level atlamayı engellemek için, veritabanında trigger veya stored procedure gibi yapılar da kullanılabilir. Ancak bu yöntem genellikle önerilmez çünkü performans sorunlarına yol açabilir. Bunun yerine C++ seviyesinde işlem yapılması daha verimlidir.

Sunucu Compile ve Test
Değişiklikleri yaptıktan sonra, sunucu kaynak kodlarını yeniden derlemek (compile) gerekir. Bu işlem sırasında hata alınmaması için dikkatli olunmalıdır. Compile işlemi tamamlandıktan sonra test sunucusunda bu sistemin doğru çalışıp çalışmadığı kontrol edilmelidir. Oyuncu 120. levele ulaştığında EXP alımı durmalı ve sistemsel olarak herhangi bir aksaklık olmamalıdır.

Sonuç
Metin2 özel sunucularında belli bir dereceden sonra derece kasmayı engellemek, oyun içi dengeyi korumanın etkili yollarından biridir. Bu işlem, C++ kodlama bilgisi gerektirse de, doğru yapılandırıldığında sunucu performansını etkilemeden güvenli bir şekilde uygulanabilir. Ayrıca, Python tabanlı yönetim sistemleri ile bu işlem daha da kolaylaştırılabilir.


Preventing Level Gain Beyond a Certain Point in Metin2 Servers

When developing Metin2 private servers, you may want to prevent players from gaining experience or leveling up beyond a certain point. This is often done to maintain game balance, support PvP-focused gameplay, or for special events. In this article, we'll examine in detail how to prevent level gain after a specific level. This process is typically achieved by editing the C++ server source code.

Why Should Leveling Be Stopped at a Certain Point?
Setting a maximum level cap can make sense in order to preserve in-game balance. For example, allowing levels up to 120 but preventing advancement beyond that ensures newer players have room to grow, maintains balanced PvP environments, and preserves item economy balance. Such adjustments are especially important in PvP systems.

Adjustments in C++ Server Source Code
The Metin2 server software is mostly written in C++. Therefore, modifications must be made in the source code of the game and auth services. Functions related to player experience gain are usually located in files like char.cpp. Here, a condition can be added to check the player's current level, and if the defined level is reached, experience gain can be stopped or a warning message can be sent.

As an example, here is a code block that prevents experience gain once the player reaches level 120:

Kod:
if (ch->GetLevel() >= 120)[BR][/BR]{[BR][/BR]    ch->ChatPacket(CHAT_TYPE_INFO, 'Maximum level reached. EXP gain stopped.');[BR][/BR]    return;[BR][/BR]}


Control via GUI in Python
Some server configurations operate with Python-based management systems. In such cases, level restrictions can also be applied through structures like py root and uiscript. These systems are often integrated with tools like Martysama and managed via admin panels where server administrators can easily adjust level limits.

Database-Level Level Checks
In the server database (usually MySQL), character levels are stored in the player table. Triggers or stored procedures could be used to prevent level gains, but this method is generally not recommended due to potential performance issues. Instead, performing these checks at the C++ level is more efficient.

Server Compile and Testing
After making the necessary changes, the server source code must be recompiled. Care should be taken during the compile process to avoid errors. Once compilation is complete, the system should be tested on a test server to ensure that the level cap functions properly. Upon reaching level 120, the player should stop gaining EXP, and no system errors should occur.

Conclusion
Preventing further level gain beyond a certain point in Metin2 private servers is an effective way to maintain in-game balance. Although this process requires knowledge of C++ coding, when configured correctly, it can be safely implemented without affecting server performance. Moreover, Python-based management systems can simplify this process.
 

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

Geri
Üst Alt